@istock/iswork / Exports / MessageIterator
Class: MessageIterator
异步消息函数遍历处理机制
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new MessageIterator(): MessageIterator
Returns
Properties
#event
• Private
Readonly
#event: EventEmitter
Defined in
src/packages/iswork/src/message/message-iterator.ts:10
Methods
#messageAsyncGenerator
▸ #messageAsyncGenerator(): AsyncGenerator
<TMessageIteratorData
, void
, unknown
>
异步消息生成器函数
Returns
AsyncGenerator
<TMessageIteratorData
, void
, unknown
>
Defined in
src/packages/iswork/src/message/message-iterator.ts:15
complete
▸ complete(message?
): Promise
<void
>
消息传递完成调用方法
Parameters
Name | Type |
---|---|
message | TMessageIteratorData |
Returns
Promise
<void
>
Defined in
src/packages/iswork/src/message/message-iterator.ts:34
send
▸ send(message?
): Promise
<void
>
发送消息
Parameters
Name | Type |
---|---|
message | TMessageIteratorData |
Returns
Promise
<void
>
Defined in
src/packages/iswork/src/message/message-iterator.ts:44
create
▸ create(callback
): AsyncIterator
<TMessageIteratorData
, void
, unknown
>
创建一个Generator异步消息函数
Parameters
Name | Type |
---|---|
callback | (messageIterator : MessageIterator ) => void |
Returns
AsyncIterator
<TMessageIteratorData
, void
, unknown
>
Defined in
src/packages/iswork/src/message/message-iterator.ts:52