@orkestrel/agent 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1102,6 +1102,18 @@ export declare interface AuthorityRule {
1102
1102
  * `push` / `close` / `fail` enqueue/flag, then fire `#wake` so the parked reader wakes,
1103
1103
  * re-reads the buffer, and either yields the next chunk, returns (on `close`), or throws
1104
1104
  * (on `fail`). Event-free, no `!` / `as` / `any`.
1105
+ *
1106
+ * @example
1107
+ * ```ts
1108
+ * import { Channel } from '@orkestrel/agent'
1109
+ *
1110
+ * const channel = new Channel<number>()
1111
+ * channel.push(1)
1112
+ * channel.close()
1113
+ * for await (const value of channel.drain()) {
1114
+ * value // 1
1115
+ * }
1116
+ * ```
1105
1117
  */
1106
1118
  export declare class Channel<T> {
1107
1119
  #private;
@@ -1102,6 +1102,18 @@ export declare interface AuthorityRule {
1102
1102
  * `push` / `close` / `fail` enqueue/flag, then fire `#wake` so the parked reader wakes,
1103
1103
  * re-reads the buffer, and either yields the next chunk, returns (on `close`), or throws
1104
1104
  * (on `fail`). Event-free, no `!` / `as` / `any`.
1105
+ *
1106
+ * @example
1107
+ * ```ts
1108
+ * import { Channel } from '@orkestrel/agent'
1109
+ *
1110
+ * const channel = new Channel<number>()
1111
+ * channel.push(1)
1112
+ * channel.close()
1113
+ * for await (const value of channel.drain()) {
1114
+ * value // 1
1115
+ * }
1116
+ * ```
1105
1117
  */
1106
1118
  export declare class Channel<T> {
1107
1119
  #private;
@@ -1287,6 +1287,18 @@ var AgentContext = class {
1287
1287
  * `push` / `close` / `fail` enqueue/flag, then fire `#wake` so the parked reader wakes,
1288
1288
  * re-reads the buffer, and either yields the next chunk, returns (on `close`), or throws
1289
1289
  * (on `fail`). Event-free, no `!` / `as` / `any`.
1290
+ *
1291
+ * @example
1292
+ * ```ts
1293
+ * import { Channel } from '@orkestrel/agent'
1294
+ *
1295
+ * const channel = new Channel<number>()
1296
+ * channel.push(1)
1297
+ * channel.close()
1298
+ * for await (const value of channel.drain()) {
1299
+ * value // 1
1300
+ * }
1301
+ * ```
1290
1302
  */
1291
1303
  var Channel = class {
1292
1304
  #buffer = [];