forked from bot/app
12 lines
7.4 KiB
JavaScript
12 lines
7.4 KiB
JavaScript
import{_ as e,o as n,c as a,e as t}from"./app-DuYQPtzk.js";const l={},s=t(`<h3 id="class-channeldeliver" tabindex="-1"><a class="header-anchor" href="#class-channeldeliver"><span><em><strong>class</strong></em> <code>ChannelDeliver</code></span></a></h3><h3 id="def-init-self-active-channel-any-passive-channel-any-channel-deliver-active-channel-channel-any-channel-deliver-passive-channel-tuple-str-dict-none" tabindex="-1"><a class="header-anchor" href="#def-init-self-active-channel-any-passive-channel-any-channel-deliver-active-channel-channel-any-channel-deliver-passive-channel-tuple-str-dict-none"><span> <em><strong>def</strong></em> <code>__init__(self, active: Channel[Any], passive: Channel[Any], channel_deliver_active: Channel[Channel[Any]], channel_deliver_passive: Channel[tuple[str, dict]]) -> None</code></span></a></h3><p> </p><h3 id="class-processmanager" tabindex="-1"><a class="header-anchor" href="#class-processmanager"><span><em><strong>class</strong></em> <code>ProcessManager</code></span></a></h3><p>进程管理器</p><h3 id="def-init-self-lifespan-lifespan-none" tabindex="-1"><a class="header-anchor" href="#def-init-self-lifespan-lifespan-none"><span> <em><strong>def</strong></em> <code>__init__(self, lifespan: 'Lifespan') -> None</code></span></a></h3><p> </p><h3 id="def-start-self-name-str-none" tabindex="-1"><a class="header-anchor" href="#def-start-self-name-str-none"><span> <em><strong>def</strong></em> <code>start(self, name: str) -> None</code></span></a></h3><p> 开启后自动监控进程,并添加到进程字典中</p><p>Args:</p><pre><code>name:
|
||
</code></pre><p>Returns:</p><h3 id="def-start-all-self-none" tabindex="-1"><a class="header-anchor" href="#def-start-all-self-none"><span> <em><strong>def</strong></em> <code>start_all(self) -> None</code></span></a></h3><p> 启动所有进程</p><h3 id="def-add-target-self-name-str-target-target-func-args-tuple-kwargs-any-none" tabindex="-1"><a class="header-anchor" href="#def-add-target-self-name-str-target-target-func-args-tuple-kwargs-any-none"><span> <em><strong>def</strong></em> <code>add_target(self, name: str, target: TARGET_FUNC, args: tuple, kwargs: Any) -> None</code></span></a></h3><p> 添加进程</p><p>Args:</p><pre><code>name: 进程名,用于获取和唯一标识
|
||
|
||
target: 进程函数
|
||
|
||
args: 进程函数参数
|
||
|
||
kwargs: 进程函数关键字参数,通常会默认传入chan_active和chan_passive
|
||
</code></pre><h3 id="def-join-all-self-none" tabindex="-1"><a class="header-anchor" href="#def-join-all-self-none"><span> <em><strong>def</strong></em> <code>join_all(self) -> None</code></span></a></h3><p> </p><h3 id="def-terminate-self-name-str-none" tabindex="-1"><a class="header-anchor" href="#def-terminate-self-name-str-none"><span> <em><strong>def</strong></em> <code>terminate(self, name: str) -> None</code></span></a></h3><p> 终止进程并从进程字典中删除</p><p>Args:</p><pre><code>name:
|
||
</code></pre><p>Returns:</p><h3 id="def-terminate-all-self-none" tabindex="-1"><a class="header-anchor" href="#def-terminate-all-self-none"><span> <em><strong>def</strong></em> <code>terminate_all(self) -> None</code></span></a></h3><p> </p><h3 id="def-is-process-alive-self-name-str-bool" tabindex="-1"><a class="header-anchor" href="#def-is-process-alive-self-name-str-bool"><span> <em><strong>def</strong></em> <code>is_process_alive(self, name: str) -> bool</code></span></a></h3><p> 检查进程是否存活</p><p>Args:</p><pre><code>name:
|
||
</code></pre><p>Returns:</p>`,32),r=[s];function i(o,c){return n(),a("div",null,r)}const p=e(l,[["render",i],["__file","manager.html.vue"]]),f=JSON.parse(`{"path":"/en/dev/api/liteyuki/core/manager.html","title":"liteyuki.core.manager","lang":"en-US","frontmatter":{"title":"liteyuki.core.manager","order":1,"icon":"laptop-code","category":"API","description":"class ChannelDeliver def __init__(self, active: Channel[Any], passive: Channel[Any], channel_deliver_active: Channel[Channel[Any]], channel_deliver_passive: Channel[tuple[str, d...","head":[["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/en/dev/api/liteyuki/core/manager.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot"}],["meta",{"property":"og:title","content":"liteyuki.core.manager"}],["meta",{"property":"og:description","content":"class ChannelDeliver def __init__(self, active: Channel[Any], passive: Channel[Any], channel_deliver_active: Channel[Channel[Any]], channel_deliver_passive: Channel[tuple[str, d..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-08-19T02:04:24.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-19T02:04:24.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.core.manager\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2024-08-19T02:04:24.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":3,"title":"class ChannelDeliver","slug":"class-channeldeliver","link":"#class-channeldeliver","children":[]},{"level":3,"title":"def __init__(self, active: Channel[Any], passive: Channel[Any], channel_deliver_active: Channel[Channel[Any]], channel_deliver_passive: Channel[tuple[str, dict]]) -> None","slug":"def-init-self-active-channel-any-passive-channel-any-channel-deliver-active-channel-channel-any-channel-deliver-passive-channel-tuple-str-dict-none","link":"#def-init-self-active-channel-any-passive-channel-any-channel-deliver-active-channel-channel-any-channel-deliver-passive-channel-tuple-str-dict-none","children":[]},{"level":3,"title":"class ProcessManager","slug":"class-processmanager","link":"#class-processmanager","children":[]},{"level":3,"title":"def __init__(self, lifespan: 'Lifespan') -> None","slug":"def-init-self-lifespan-lifespan-none","link":"#def-init-self-lifespan-lifespan-none","children":[]},{"level":3,"title":"def start(self, name: str) -> None","slug":"def-start-self-name-str-none","link":"#def-start-self-name-str-none","children":[]},{"level":3,"title":"def start_all(self) -> None","slug":"def-start-all-self-none","link":"#def-start-all-self-none","children":[]},{"level":3,"title":"def add_target(self, name: str, target: TARGET_FUNC, args: tuple, kwargs: Any) -> None","slug":"def-add-target-self-name-str-target-target-func-args-tuple-kwargs-any-none","link":"#def-add-target-self-name-str-target-target-func-args-tuple-kwargs-any-none","children":[]},{"level":3,"title":"def join_all(self) -> None","slug":"def-join-all-self-none","link":"#def-join-all-self-none","children":[]},{"level":3,"title":"def terminate(self, name: str) -> None","slug":"def-terminate-self-name-str-none","link":"#def-terminate-self-name-str-none","children":[]},{"level":3,"title":"def terminate_all(self) -> None","slug":"def-terminate-all-self-none","link":"#def-terminate-all-self-none","children":[]},{"level":3,"title":"def is_process_alive(self, name: str) -> bool","slug":"def-is-process-alive-self-name-str-bool","link":"#def-is-process-alive-self-name-str-bool","children":[]}],"git":{"createdTime":1724031826000,"updatedTime":1724033064000,"contributors":[{"name":"snowy","email":"snowykami@outlook.com","commits":3}]},"readingTime":{"minutes":0.69,"words":207},"filePathRelative":"en/dev/api/liteyuki/core/manager.md","localizedDate":"August 19, 2024","autoDesc":true}`);export{p as comp,f as data};
|