2024-08-19 00:15:19 +08:00
import { _ as e , r as t , o , c as p , b as n , d as s , a as c , e as i } from "./app-DOGtdh9N.js" ; const l = { } , u = i ( ` <h2 id="通道通信" tabindex="-1"><a class="header-anchor" href="#通道通信"><span><strong>通道通信</strong></span></a></h2><h3 id="简介" tabindex="-1"><a class="header-anchor" href="#简介"><span>简介</span></a></h3><p>轻雪运行在主进程 MainProcess 里,其他插件框架进程是伴随的子进程,因此无法通过内存共享和直接对象传递的方式进行通信,轻雪提供了一个通道<code>Channel</code>用于跨进程通信,你可以通过<code>Channel</code>发送消息给其他进程,也可以监听其他进程的消息。</p><p>例如子进程接收到用户信息需要重启机器人,这时可以通过通道对主进程发送消息,主进程接收到消息后重启对应子进程。</p><h3 id="示例" tabindex="-1"><a class="header-anchor" href="#示例"><span>示例</span></a></h3><p>通道是全双工的,有两种接收模式,但一个通道只能使用一种,即被动模式和主动模式,被动模式由<code>chan.on_receive()</code>装饰回调函数实现,主动模式需调用<code>chan.receive()</code>实现</p><ul><li>创建子进程的同时会初始化一个被动通道和一个主动通道,且通道标识为<code>{process_name}-active</code>和<code>{process_name}-passive</code>, </li><li>主进程中通过<code>get_channel</code>函数获取通道对象</li><li>子进程中导入单例<code>active_channel</code>及<code>passive_channel</code>即可</li></ul><blockquote><p>在轻雪插件中(主进程中)</p></blockquote><div class="language-python line-numbers-mode" data-ext="py" data-title="py"><pre class="language-python"><code><span class="token keyword">import</span> asyncio
2024-08-12 05:51:00 +08:00
< span class = "token keyword" > from < / s p a n > l i t e y u k i < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > c o m m < s p a n c l a s s = " t o k e n k e y w o r d " > i m p o r t < / s p a n > g e t _ c h a n n e l < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > , < / s p a n > C h a n n e l
< span class = "token keyword" > from < / s p a n > l i t e y u k i < s p a n c l a s s = " t o k e n k e y w o r d " > i m p o r t < / s p a n > g e t _ b o t
2024-08-17 00:31:56 +08:00
2024-08-12 06:07:50 +08:00
< span class = "token comment" > # get _channel函数获取通道对象 , 参数为调用set _channel时的通道标识 < / s p a n >
2024-08-17 00:31:56 +08:00
channel _passive < span class = "token operator" >= < / s p a n > g e t _ c h a n n e l < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; n o n e b o t - p a s s i v e & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n c o m m e n t " > # 获 取 被 动 通 道 < / s p a n >
2024-08-12 06:07:50 +08:00
channel _active < span class = "token operator" >= < / s p a n > g e t _ c h a n n e l < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; n o n e b o t - a c t i v e & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n c o m m e n t " > # 获 取 主 动 通 道 < / s p a n >
2024-08-12 05:51:00 +08:00
liteyuki _bot < span class = "token operator" >= < / s p a n > g e t _ b o t < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-17 00:31:56 +08:00
2024-08-12 06:07:50 +08:00
< span class = "token comment" > # 注册一个函数在轻雪启动后运行 < / s p a n >
2024-08-12 05:51:00 +08:00
< span class = "token decorator annotation punctuation" > @ liteyuki _bot < span class = "token punctuation" > . < / s p a n > o n _ a f t e r _ s t a r t < / s p a n >
2024-08-17 00:31:56 +08:00
< span class = "token keyword" > async < / s p a n > < s p a n c l a s s = " t o k e n k e y w o r d " > d e f < / s p a n > < s p a n c l a s s = " t o k e n f u n c t i o n " > s e n d _ d a t a < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > : < / s p a n >
2024-08-12 05:51:00 +08:00
< span class = "token keyword" > while < / s p a n > < s p a n c l a s s = " t o k e n b o o l e a n " > T r u e < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > : < / s p a n >
channel _passive < span class = "token punctuation" > . < / s p a n > s e n d < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; I a m l i t e y u k i m a i n p r o c e s s p a s s i v e & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
channel _active < span class = "token punctuation" > . < / s p a n > s e n d < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; I a m l i t e y u k i m a i n p r o c e s s a c t i v e & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-17 00:31:56 +08:00
< span class = "token keyword" > await < / s p a n > a s y n c i o < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > s l e e p < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n n u m b e r " > 3 < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n c o m m e n t " > # 每 3 秒 发 送 一 次 消 息 < / s p a n >
< / c o d e > < / p r e > < d i v c l a s s = " l i n e - n u m b e r s " a r i a - h i d d e n = " t r u e " > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < / d i v > < / d i v > < b l o c k q u o t e > < p > 在 子 进 程 中 ( 例 如 N o n e B o t 插 件 中 ) < / p > < / b l o c k q u o t e > < d i v c l a s s = " l a n g u a g e - p y t h o n l i n e - n u m b e r s - m o d e " d a t a - e x t = " p y " d a t a - t i t l e = " p y " > < p r e c l a s s = " l a n g u a g e - p y t h o n " > < c o d e > < s p a n c l a s s = " t o k e n k e y w o r d " > f r o m < / s p a n > n o n e b o t < s p a n c l a s s = " t o k e n k e y w o r d " > i m p o r t < / s p a n > g e t _ d r i v e r
< span class = "token keyword" > from < / s p a n > l i t e y u k i < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > c o m m < s p a n c l a s s = " t o k e n k e y w o r d " > i m p o r t < / s p a n > a c t i v e _ c h a n n e l < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > , < / s p a n > p a s s i v e _ c h a n n e l < s p a n c l a s s = " t o k e n c o m m e n t " > # 子 进 程 中 获 取 通 道 直 接 导 入 进 程 全 局 单 例 即 可 < / s p a n >
2024-08-12 05:51:00 +08:00
< span class = "token keyword" > from < / s p a n > l i t e y u k i < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > l o g < s p a n c l a s s = " t o k e n k e y w o r d " > i m p o r t < / s p a n > l o g g e r
driver < span class = "token operator" >= < / s p a n > g e t _ d r i v e r < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-12 06:07:50 +08:00
< span class = "token comment" > # 被动模式 , 通过装饰器注册一个函数在接收到消息时运行 , 每次接收到字符串数据时都会运行 < / s p a n >
2024-08-17 00:31:56 +08:00
< span class = "token decorator annotation punctuation" > @ passive _channel < span class = "token punctuation" > . < / s p a n > o n _ r e c e i v e < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > f i l t e r _ f u n c < s p a n c l a s s = " t o k e n o p e r a t o r " > = < / s p a n > < s p a n c l a s s = " t o k e n k e y w o r d " > l a m b d a < / s p a n > d a t a < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > : < / s p a n > < s p a n c l a s s = " t o k e n b u i l t i n " > i s i n s t a n c e < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > d a t a < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > , < / s p a n > < s p a n c l a s s = " t o k e n b u i l t i n " > s t r < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-12 05:51:00 +08:00
< span class = "token keyword" > async < / s p a n > < s p a n c l a s s = " t o k e n k e y w o r d " > d e f < / s p a n > < s p a n c l a s s = " t o k e n f u n c t i o n " > o n _ p a s s i v e _ r e c e i v e < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > d a t a < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > : < / s p a n >
logger < span class = "token punctuation" > . < / s p a n > i n f o < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g - i n t e r p o l a t i o n " > < s p a n c l a s s = " t o k e n s t r i n g " > f & q u o t ; P a s s i v e r e c e i v e : < / s p a n > < s p a n c l a s s = " t o k e n i n t e r p o l a t i o n " > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > { < / s p a n > d a t a < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > } < / s p a n > < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; < / s p a n > < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-17 00:31:56 +08:00
2024-08-12 06:07:50 +08:00
< span class = "token comment" > # 注册一个函数在NoneBot启动后运行 < / s p a n >
2024-08-12 05:51:00 +08:00
< span class = "token decorator annotation punctuation" > @ driver < span class = "token punctuation" > . < / s p a n > o n _ s t a r t u p < / s p a n >
2024-08-17 00:31:56 +08:00
< span class = "token keyword" > def < / s p a n > < s p a n c l a s s = " t o k e n f u n c t i o n " > o n _ s t a r t u p < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > : < / s p a n >
2024-08-12 05:51:00 +08:00
< span class = "token keyword" > while < / s p a n > < s p a n c l a s s = " t o k e n b o o l e a n " > T r u e < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > : < / s p a n >
2024-08-17 00:31:56 +08:00
data < span class = "token operator" >= < / s p a n > a c t i v e _ c h a n n e l < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > r e c e i v e < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-12 05:51:00 +08:00
logger < span class = "token punctuation" > . < / s p a n > i n f o < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g - i n t e r p o l a t i o n " > < s p a n c l a s s = " t o k e n s t r i n g " > f & q u o t ; A c t i v e r e c e i v e : < / s p a n > < s p a n c l a s s = " t o k e n i n t e r p o l a t i o n " > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > { < / s p a n > d a t a < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > } < / s p a n > < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; < / s p a n > < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n >
2024-08-17 00:31:56 +08:00
< / c o d e > < / p r e > < d i v c l a s s = " l i n e - n u m b e r s " a r i a - h i d d e n = " t r u e " > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < / d i v > < / d i v > < b l o c k q u o t e > < p > 启 动 后 控 制 台 输 出 < / p > < / b l o c k q u o t e > < d i v c l a s s = " l a n g u a g e - l o g l i n e - n u m b e r s - m o d e " d a t a - e x t = " l o g " d a t a - t i t l e = " l o g " > < p r e c l a s s = " l a n g u a g e - l o g " > < c o d e > < s p a n c l a s s = " t o k e n d a t e n u m b e r " > 0 0 0 0 - 0 0 - 0 0 < / s p a n > < s p a n c l a s s = " t o k e n t i m e n u m b e r " > 0 0 : 0 0 : 0 0 < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > [ < / s p a n > ℹ ️ 信 息 < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ] < / s p a n > < s p a n c l a s s = " t o k e n p r o p e r t y " > P a s s i v e r e c e i v e : < / s p a n > I a m l i t e y u k i m a i n p r o c e s s p a s s i v e
< span class = "token date number" > 0000 - 00 - 00 < / s p a n > < s p a n c l a s s = " t o k e n t i m e n u m b e r " > 0 0 : 0 0 : 0 0 < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > [ < / s p a n > ℹ ️ 信 息 < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ] < / s p a n > < s p a n c l a s s = " t o k e n p r o p e r t y " > A c t i v e r e c e i v e : < / s p a n > I a m l i t e y u k i m a i n p r o c e s s a c t i v e
< span class = "token date number" > 0000 - 00 - 00 < / s p a n > < s p a n c l a s s = " t o k e n t i m e n u m b e r " > 0 0 : 0 0 : 0 3 < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > [ < / s p a n > ℹ ️ 信 息 < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ] < / s p a n > < s p a n c l a s s = " t o k e n p r o p e r t y " > P a s s i v e r e c e i v e : < / s p a n > I a m l i t e y u k i m a i n p r o c e s s p a s s i v e
< span class = "token date number" > 0000 - 00 - 00 < / s p a n > < s p a n c l a s s = " t o k e n t i m e n u m b e r " > 0 0 : 0 0 : 0 3 < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > [ < / s p a n > ℹ ️ 信 息 < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ] < / s p a n > < s p a n c l a s s = " t o k e n p r o p e r t y " > A c t i v e r e c e i v e : < / s p a n > I a m l i t e y u k i m a i n p r o c e s s a c t i v e
< span class = "token punctuation" > . < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n >
< / c o d e > < / p r e > < d i v c l a s s = " l i n e - n u m b e r s " a r i a - h i d d e n = " t r u e " > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < / d i v > < / d i v > < h 2 i d = " 共 享 内 存 通 信 " t a b i n d e x = " - 1 " > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # 共 享 内 存 通 信 " > < s p a n > < s t r o n g > 共 享 内 存 通 信 < / s t r o n g > < / s p a n > < / a > < / h 2 > < h 3 i d = " 简 介 - 1 " t a b i n d e x = " - 1 " > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # 简 介 - 1 " > < s p a n > 简 介 < / s p a n > < / a > < / h 3 > < u l > < l i > 相 比 于 普 通 进 程 通 信 , 内 存 共 享 使 得 代 码 编 写 更 加 简 洁 , 轻 雪 框 架 提 供 了 一 个 内 存 共 享 通 信 的 接 口 , 你 可 以 通 过 < c o d e > s t o r a g e < / c o d e > 模 块 实 现 内 存 共 享 通 信 , 该 模 块 封 装 通 道 实 现 < / l i > < l i > 内 存 共 享 是 线 程 安 全 的 , 你 可 以 在 多 个 线 程 中 读 写 共 享 内 存 , 线 程 锁 会 自 动 保 护 共 享 内 存 的 读 写 操 作 < / l i > < / u l > < h 3 i d = " 示 例 - 1 " t a b i n d e x = " - 1 " > < a c l a s s = " h e a d e r - a n c h o r " h r e f = " # 示 例 - 1 " > < s p a n > 示 例 < / s p a n > < / a > < / h 3 > < b l o c k q u o t e > < p > 在 任 意 进 程 中 均 可 使 用 < / p > < / b l o c k q u o t e > < d i v c l a s s = " l a n g u a g e - p y t h o n l i n e - n u m b e r s - m o d e " d a t a - e x t = " p y " d a t a - t i t l e = " p y " > < p r e c l a s s = " l a n g u a g e - p y t h o n " > < c o d e > < s p a n c l a s s = " t o k e n k e y w o r d " > f r o m < / s p a n > l i t e y u k i < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > c o m m < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > s t o r a g e < s p a n c l a s s = " t o k e n k e y w o r d " > i m p o r t < / s p a n > s h a r e d _ m e m o r y
2024-08-17 00:18:57 +08:00
shared _memory < span class = "token punctuation" > . < / s p a n > < s p a n c l a s s = " t o k e n b u i l t i n " > s e t < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; k e y & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > , < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; v a l u e & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n c o m m e n t " > # 设 置 共 享 内 存 < / s p a n >
value < span class = "token operator" >= < / s p a n > s h a r e d _ m e m o r y < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > . < / s p a n > g e t < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ( < / s p a n > < s p a n c l a s s = " t o k e n s t r i n g " > & q u o t ; k e y & q u o t ; < / s p a n > < s p a n c l a s s = " t o k e n p u n c t u a t i o n " > ) < / s p a n > < s p a n c l a s s = " t o k e n c o m m e n t " > # 获 取 共 享 内 存 < / s p a n >
2024-08-17 02:40:51 +08:00
< / c o d e > < / p r e > < d i v c l a s s = " l i n e - n u m b e r s " a r i a - h i d d e n = " t r u e " > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < d i v c l a s s = " l i n e - n u m b e r " > < / d i v > < / d i v > < / d i v > ` , 1 9 ) , r = { h r e f : " h t t p s : / / g i t h u b . c o m / L i t e y u k i S t u d i o / L i t e y u k i B o t / b l o b / m a i n / l i t e y u k i / c o m m / s t o r a g e . p y " , t a r g e t : " _ b l a n k " , r e l : " n o o p e n e r n o r e f e r r e r " } ; f u n c t i o n d ( k , m ) { c o n s t a = t ( " E x t e r n a l L i n k I c o n " ) ; r e t u r n o ( ) , p ( " d i v " , n u l l , [ u , n ( " p " , n u l l , [ s ( " 源 代 码 : " ) , n ( " a " , r , [ s ( " l i t e y u k i / c o m m / s t o r a g e . p y " ) , c ( a ) ] ) ] ) ] ) } c o n s t h = e ( l , [ [ " r e n d e r " , d ] , [ " _ _ f i l e " , " d e v _ c o m m . h t m l . v u e " ] ] ) , b = J S O N . p a r s e ( ' { " p a t h " : " / d e v / d e v _ c o m m . h t m l " , " t i t l e " : " 进 程 通 信 " , " l a n g " : " z h - C N " , " f r o n t m a t t e r " : { " t i t l e " : " 进 程 通 信 " , " i c o n " : " e x c h a n g e - a l t " , " o r d e r " : 4 , " c a t e g o r y " : " 开 发 " , " d e s c r i p t i o n " : " 通 道 通 信 简 介 轻 雪 运 行 在 主 进 程 M a i n P r o c e s s 里 , 其 他 插 件 框 架 进 程 是 伴 随 的 子 进 程 , 因 此 无 法 通 过 内 存 共 享 和 直 接 对 象 传 递 的 方 式 进 行 通 信 , 轻 雪 提 供 了 一 个 通 道 C h a n n e l 用 于 跨 进 程 通 信 , 你 可 以 通 过 C h a n n e l 发 送 消 息 给 其 他 进 程 , 也 可 以 监 听 其 他 进 程 的 消 息 。 例 如 子 进 程 接 收 到 用 户 信 息 需 要 重 启 机 器 人 , 这 时 可 以 通 过 通 道 对 主 进 程 发 送 消 息 , 主 进 程 接 收 到 消 息 . . . " , " h e a d " : [ [ " l i n k " , { " r e l " : " a l t e r n a t e " , " h r e f l a n g " : " e n - u s " , " h r e f " : " h t t p s : / / v u e p r e s s - t h e m e - h o p e - d o c s - d e m o . n e t l i f y . a p p / e n / d e v / d e v _ c o m m . h t m l " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : u r l " , " c o n t e n t " : " h t t p s : / / v u e p r e s s - t h e m e - h o p e - d o c s - d e m o . n e t l i f y . a p p / d e v / d e v _ c o m m . h t m l " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : s i t e _ n a m e " , " c o n t e n t " : " L i t e y u k i B o t 轻 雪 机 器 人 " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : t i t l e " , " c o n t e n t " : " 进 程 通 信 " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : d e s c r i p t i o n " , " c o n t e n t " : " 通 道 通 信 简 介 轻 雪 运 行 在 主 进 程 M a i n P r o c e s s 里 , 其 他 插 件 框 架 进 程 是 伴 随 的 子 进 程 , 因 此 无 法 通 过 内 存 共 享 和 直 接 对 象 传 递 的 方 式 进 行 通 信 , 轻 雪 提 供 了 一 个 通 道 C h a n n e l 用 于 跨 进 程 通 信 , 你 可 以 通 过 C h a n n e l 发 送 消 息 给 其 他 进 程 , 也 可 以 监 听 其 他 进 程 的 消 息 。 例 如 子 进 程 接 收 到 用 户 信 息 需 要 重 启 机 器 人 , 这 时 可 以 通 过 通 道 对 主 进 程 发 送 消 息 , 主 进 程 接 收 到 消 息 . . . " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : t y p e " , " c o n t e n t " : " a r t i c l e " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : l o c a l e " , " c o n t e n t " : " z h - C N " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : l o c a l e : a l t e r n a t e " , " c o n t e n t " : " e n - U S " } ] , [ " m e t a " , { " p r o p e r t y " : " o g : u p d a t e d _ t i m e " , " c o n t e n t " : " 2 0 2 4 - 0 8 - 1 6 T 1 6 : 3 9 : 4 9 . 0 0 0 Z " } ] , [ " m e t a " , { " p r o p e r t y " : " a r t i c l e : m o d i f i e d _ t i m e " , " c o n t e n t " : " 2 0 2 4 - 0 8 - 1 6 T 1 6 : 3 9 : 4 9 . 0 0 0 Z " } ] , [ " s c r i p t " , { " t y p e " : " a p p l i c a t i o n / l d + j s o n " } , " { \ \ " @ c o n t e x t \ \ " : \ \ " h t t p s : / / s c h e m a . o r g \ \ " , \ \ " @ t y p e \ \ " : \ \ " A r t i c l e \ \ " , \ \ " h e a d l i n e \ \ " : \ \ " 进 程 通 信 \ \ " , \ \ " i m a g e \ \ " : [ \ \ " \ \ " ] , \ \ " d a t e M o d i f i e d \ \ " : \ \ " 2 0 2 4 - 0 8 - 1 6 T 1 6 : 3 9 : 4 9 . 0 0 0 Z \ \ " , \ \ " a u t h o r \ \ " : [ ] } " ] ] } , " h e a d e r s " : [ { " l e v e l " : 2 , " t i t l e " : " 通 道 通 信 " , " s l u g " : " 通 道 通 信 " , " l i n k " : " # 通 道 通 信 " , " c h i l d r e n " : [ { " l e v e l " : 3 , " t i t l e " : " 简 介 " , " s l u g " : " 简 介 " , " l i n k " : " # 简 介 " , " c h i l d r e n " : [ ] } , { " l e v e l " : 3 , " t i t l e " : " 示 例 " , " s l u g " : " 示 例 " , " l i n k " : " # 示 例 " , " c h i l d r e n " : [ ] } ] } , { " l e v e l " : 2 , " t i t l e " : " 共 享 内 存 通 信 " , " s l u g " : " 共 享 内 存 通 信 " , " l i n k " : " # 共 享 内 存 通 信 " , " c h i l d r e n " : [ { " l e v e l " : 3 , " t i t l e " : " 简 介 " , " s l u g " : " 简 介 - 1 " , " l i n k " : " # 简 介 - 1 " , " c h i l d r e n " : [ ] } , { " l e v e l " : 3 , " t i t l e " : " 示 例 " , " s l u g " : " 示 例 - 1 " , " l i n k " : " # 示 例 - 1 " , " c h i l d r e n " : [ ] } ] } ] , " g i t " : { " c r e a t e d T i m e " : 1 7 2 3 4 1 3 0 1 2 0 0 0 , " u p d a t e d T i m e " : 1 7 2 3 8 2 6 3 8 9 0 0 0 , " c o n t r i b u t o r s " : [ { " n a m e " : " s n o w y " , " e m a i l " : " s n o w y k a m i @ o u t l o o k . c o m " , " c o m m i t s " : 4 } , { " n a m e " : " S n o w y k a m i " , " e m a i l " : " s n o w y k a m i @ o u t l o o k . c o m " , " c o m m i t s " : 1 } ] } , " r e a d i n g T i m e " : { " m i n u t e s " : 2 . 5 2 , " w o r d s " : 7 5 7 } , " f i l e P a t h R e l a t i v e " : " d e v / d e v _ c o m m . m d " , " l o c a l i z e d D a t e " : " 2 0 2 4 年 8 月 1 1 日 " , " a u t o D e s c " : t r u e } ' ) ; e x p o r t { h a s c o m p , b a s d a t a } ;