Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions js/net/api/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,13 @@ export namespace Origin {
announced(scope?: Path.Pattern, options?: Announce.Options): Announce.Consumer;
get closed(): Signals.GetPromise<Error | null>;
get discovery(): Signals.Getter<boolean | undefined>;
follow(path: Path.Valid, options?: Origin.RequestOptions): Origin.Following;
follow(path: Path.Valid, options?: Origin.FollowOptions): Origin.Following;
request(path: Path.Valid, options?: Origin.RequestOptions): Origin.Requesting;
}
export type Cost = bigint;
export interface FollowOptions {
instance?: Instance.Valid;
}
export class Following {
readonly active: Signals.Getter<Broadcast.Consumer | undefined>;
close(): void;
Expand All @@ -414,7 +417,7 @@ export namespace Origin {
consume(): Origin.Consumer;
createBroadcast(path: Path.Valid): Origin.Publication;
get discovery(): Signals.Getter<boolean | undefined>;
follow(path: Path.Valid, options?: Origin.RequestOptions): Origin.Following;
follow(path: Path.Valid, options?: Origin.FollowOptions): Origin.Following;
request(path: Path.Valid, options?: Origin.RequestOptions): Origin.Requesting;
requests(prefix: Path.Valid): Origin.Requests;
scope(root: Path.Valid, patterns: Path.Patterns): Origin.Producer;
Expand All @@ -435,7 +438,7 @@ export namespace Origin {
announced(scope?: Path.Pattern, options?: Announce.Options): Announce.Consumer;
readonly closed: Signals.GetPromise<Error | null>;
readonly discovery: Signals.Getter<boolean | undefined>;
follow(path: Path.Valid, options?: Origin.RequestOptions): Origin.Following;
follow(path: Path.Valid, options?: Origin.FollowOptions): Origin.Following;
request(path: Path.Valid, options?: Origin.RequestOptions): Origin.Requesting;
}
export class Request {
Expand Down
14 changes: 10 additions & 4 deletions js/net/src/origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ export interface Reader {
request(path: Path.Valid, options?: RequestOptions): Requesting;

/** Follow `path` across publisher instances; see {@link Consumer.follow}. */
follow(path: Path.Valid, options?: RequestOptions): Following;
follow(path: Path.Valid, options?: FollowOptions): Following;

/** The available broadcasts under `scope`, as a live stream; see {@link Consumer.announced}. */
announced(scope?: Path.Pattern, options?: Announce.Options): Announce.Consumer;
Expand Down Expand Up @@ -1258,12 +1258,18 @@ export interface Table extends Reader {
): Requests;
}

/** Options for resolving a broadcast path, by {@link Consumer.request} or {@link Consumer.follow}. */
/** Options for resolving one publisher instance with {@link Consumer.request}. */
export interface RequestOptions {
/** Refuse a different publisher instance, including an asynchronous answer or a retry. */
instance?: Instance.Valid;
}

/** Options for following a broadcast path with {@link Consumer.follow}. */
export interface FollowOptions {
/** Follow only this publisher instance, waiting for it to return across gaps. */
instance?: Instance.Valid;
}

/**
* The write side of an origin: create broadcasts by path and advertise them.
*
Expand Down Expand Up @@ -1662,7 +1668,7 @@ export class Producer implements Table {
}

/** Follow `path` across publisher instances; see {@link Consumer.follow}. */
follow(path: Path.Valid, options?: RequestOptions): Following {
follow(path: Path.Valid, options?: FollowOptions): Following {
return this.#reader.follow(path, options);
}

Expand Down Expand Up @@ -1954,7 +1960,7 @@ export class Consumer implements Reader {
* its path until closed. Requires discovery: a session without it never serves a follower.
* A selected handler's refusal or the origin closing ends it.
*/
follow(path: Path.Valid, options: RequestOptions = {}): Following {
follow(path: Path.Valid, options: FollowOptions = {}): Following {
const instance = options.instance;
const absolute = this.#scope.path(path);
Path.Pattern.literal(path);
Expand Down
6 changes: 1 addition & 5 deletions quest/m1/api-audit/resolve/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Two broadcast resolutions
# [M] Two broadcast resolutions

## Goal

Expand Down Expand Up @@ -54,10 +54,6 @@ Public API: breaking task shape in moq-net; behavior changes in `@moq/net` and
the bindings. The method and epoch renames broke every wrapper.
Wire: none.

## Required

- [JS follow takes FollowOptions](/quest/m1/api-audit/resolve/follow-options.md) - `follow` and `request` get their own JS options types

## Related

- [Origin fronts park](/quest/m2/origin-front-parks.md) - touches the same retry
22 changes: 0 additions & 22 deletions quest/m1/api-audit/resolve/follow-options.md

This file was deleted.