import{_ as n,r as o,o as s,c as r,b as e,d as t,a as i,e as p}from"./app-D1iI42LG.js";const c={},l=p(`

简介

相比于普通进程通信,内存共享使得代码编写更加简洁,轻雪框架提供了一个内存共享通信的接口,你可以通过shared_memory模块实现内存共享通信 内存共享是线程安全的,你可以在多个线程中读写共享内存,线程锁会自动保护共享内存的读写操作

快速开始

from liteyuki.comm.storage import shared_memory

shared_memory.set("key", "value")  # 设置共享内存
value = shared_memory.get("key")  # 获取共享内存
`,5),m={href:"https://github.com/LiteyukiStudio/LiteyukiBot/blob/main/liteyuki/comm/storage.py",target:"_blank",rel:"noopener noreferrer"};function d(u,h){const a=o("ExternalLinkIcon");return s(),r("div",null,[l,e("ul",null,[e("li",null,[t("源代码:"),e("a",m,[t("liteyuki/comm/storage.py"),i(a)])])])])}const k=n(c,[["render",d],["__file","dev_shared_memory.html.vue"]]),_=JSON.parse('{"path":"/dev/dev_shared_memory.html","title":"内存共享通信","lang":"zh-CN","frontmatter":{"title":"内存共享通信","icon":"exchange-alt","order":5,"category":"开发","description":"简介 相比于普通进程通信,内存共享使得代码编写更加简洁,轻雪框架提供了一个内存共享通信的接口,你可以通过shared_memory模块实现内存共享通信 内存共享是线程安全的,你可以在多个线程中读写共享内存,线程锁会自动保护共享内存的读写操作 快速开始 在任意进程中均可使用 源代码:liteyuki/comm/storage.py","head":[["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/dev_shared_memory.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot 轻雪机器人"}],["meta",{"property":"og:title","content":"内存共享通信"}],["meta",{"property":"og:description","content":"简介 相比于普通进程通信,内存共享使得代码编写更加简洁,轻雪框架提供了一个内存共享通信的接口,你可以通过shared_memory模块实现内存共享通信 内存共享是线程安全的,你可以在多个线程中读写共享内存,线程锁会自动保护共享内存的读写操作 快速开始 在任意进程中均可使用 源代码:liteyuki/comm/storage.py"}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-16T16:18:06.000Z"}],["meta",{"property":"article:author","content":"远野千束"}],["meta",{"property":"article:modified_time","content":"2024-08-16T16:18:06.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"内存共享通信\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-16T16:18:06.000Z\\",\\"author\\":[{\\"@type\\":\\"Person\\",\\"name\\":\\"远野千束\\",\\"url\\":\\"https://sfkm.me\\"}]}"]]},"headers":[{"level":2,"title":"快速开始","slug":"快速开始","link":"#快速开始","children":[]}],"git":{"createdTime":1723825086000,"updatedTime":1723825086000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":1}]},"readingTime":{"minutes":0.53,"words":159},"filePathRelative":"dev/dev_shared_memory.md","localizedDate":"2024年8月16日","autoDesc":true}');export{k as comp,_ as data};