diff --git a/async/unstable_channel.ts b/async/channel.ts similarity index 93% rename from async/unstable_channel.ts rename to async/channel.ts index 277eeb94d14d..022e2fcac530 100644 --- a/async/unstable_channel.ts +++ b/async/channel.ts @@ -30,11 +30,9 @@ interface ReceiverNode { * {@linkcode Channel.send}, the `value` property carries the unsent value * for recovery. * - * @experimental **UNSTABLE**: New API, yet to be vetted. - * * @example Usage * ```ts - * import { Channel, ChannelClosedError } from "@std/async/unstable-channel"; + * import { Channel, ChannelClosedError } from "@std/async/channel"; * import { assertInstanceOf } from "@std/assert"; * * const ch = new Channel(); @@ -53,7 +51,7 @@ export class ChannelClosedError extends Error { * * @example Usage * ```ts - * import { Channel, ChannelClosedError } from "@std/async/unstable-channel"; + * import { Channel, ChannelClosedError } from "@std/async/channel"; * import { assertEquals, assertInstanceOf } from "@std/assert"; * * const ch = new Channel(); @@ -97,8 +95,6 @@ export class ChannelClosedError extends Error { * - `"empty"` — the channel is open but no value is immediately available. * - `"closed"` — the channel has been closed and no buffered values remain. * - * @experimental **UNSTABLE**: New API, yet to be vetted. - * * @typeParam T The type of the value received from the channel. */ export type ChannelReceiveResult = @@ -108,8 +104,6 @@ export type ChannelReceiveResult = /** * Options for the {@linkcode Channel} constructor. - * - * @experimental **UNSTABLE**: New API, yet to be vetted. */ export interface ChannelOptions { /** @@ -125,8 +119,6 @@ export interface ChannelOptions { /** * Options for {@linkcode Channel.send}. - * - * @experimental **UNSTABLE**: New API, yet to be vetted. */ export interface ChannelSendOptions { /** @@ -140,8 +132,6 @@ export interface ChannelSendOptions { /** * Options for {@linkcode Channel.receive}. - * - * @experimental **UNSTABLE**: New API, yet to be vetted. */ export interface ChannelReceiveOptions { /** @@ -175,11 +165,9 @@ export interface ChannelReceiveOptions { * and multiple {@linkcode Channel.toReadableStream} instances each * consume values FIFO; every value is delivered to exactly one consumer. * - * @experimental **UNSTABLE**: New API, yet to be vetted. - * * @example Basic producer/consumer * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 4 }); @@ -197,7 +185,7 @@ export interface ChannelReceiveOptions { * * @example Using `await using` for automatic cleanup * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assert } from "@std/assert"; * * let ref: Channel; @@ -251,7 +239,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 1 }); @@ -262,7 +250,7 @@ export class Channel * * @example Cancelling with an AbortSignal * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertRejects } from "@std/assert"; * * const ch = new Channel(); @@ -329,7 +317,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 1 }); @@ -340,7 +328,7 @@ export class Channel * * @example Cancelling with an AbortSignal * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertRejects } from "@std/assert"; * * const ch = new Channel(); @@ -407,7 +395,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assert, assertFalse } from "@std/assert"; * * const ch = new Channel({ capacity: 1 }); @@ -435,7 +423,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 1 }); @@ -467,7 +455,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assert } from "@std/assert"; * * const ch = new Channel(); @@ -485,7 +473,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertRejects } from "@std/assert"; * * const ch = new Channel(); @@ -525,7 +513,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assert, assertFalse } from "@std/assert"; * * const ch = new Channel(); @@ -546,7 +534,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 4 }); @@ -567,7 +555,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 8 }); @@ -586,7 +574,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 4 }); @@ -631,7 +619,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assertEquals } from "@std/assert"; * * const ch = new Channel({ capacity: 4 }); @@ -670,7 +658,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assert } from "@std/assert"; * * const ch = new Channel(); @@ -688,7 +676,7 @@ export class Channel * * @example Usage * ```ts - * import { Channel } from "@std/async/unstable-channel"; + * import { Channel } from "@std/async/channel"; * import { assert } from "@std/assert"; * * const ch = new Channel(); diff --git a/async/unstable_channel_test.ts b/async/channel_test.ts similarity index 99% rename from async/unstable_channel_test.ts rename to async/channel_test.ts index d199c2927009..df449415e7cc 100644 --- a/async/unstable_channel_test.ts +++ b/async/channel_test.ts @@ -8,7 +8,7 @@ import { assertRejects, assertThrows, } from "@std/assert"; -import { Channel, ChannelClosedError } from "./unstable_channel.ts"; +import { Channel, ChannelClosedError } from "./channel.ts"; // -- Constructor -- diff --git a/async/deno.json b/async/deno.json index 176d19c1e122..b5cbb68cecbd 100644 --- a/async/deno.json +++ b/async/deno.json @@ -4,6 +4,7 @@ "exports": { ".": "./mod.ts", "./abortable": "./abortable.ts", + "./channel": "./channel.ts", "./deadline": "./deadline.ts", "./debounce": "./debounce.ts", "./delay": "./delay.ts", @@ -20,7 +21,6 @@ "./unstable-semaphore": "./unstable_semaphore.ts", "./unstable-circuit-breaker": "./unstable_circuit_breaker.ts", "./lazy": "./lazy.ts", - "./unstable-pool-settled": "./unstable_pool_settled.ts", - "./unstable-channel": "./unstable_channel.ts" + "./unstable-pool-settled": "./unstable_pool_settled.ts" } } diff --git a/async/mod.ts b/async/mod.ts index de31ea55f712..56915d4325cb 100644 --- a/async/mod.ts +++ b/async/mod.ts @@ -16,6 +16,7 @@ */ export * from "./abortable.ts"; +export * from "./channel.ts"; export * from "./deadline.ts"; export * from "./debounce.ts"; export * from "./delay.ts";