@moq/net 0.3.5 → 0.4.0
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.
- package/announce.d.ts +7 -0
- package/announce.d.ts.map +1 -0
- package/announce.js +8 -0
- package/announce.js.map +1 -0
- package/announced.d.ts +35 -91
- package/announced.d.ts.map +1 -1
- package/announced.js +21 -156
- package/announced.js.map +1 -1
- package/bandwidth.d.ts +163 -0
- package/bandwidth.d.ts.map +1 -0
- package/bandwidth.js +304 -0
- package/bandwidth.js.map +1 -0
- package/bandwidth_api.d.ts +7 -0
- package/bandwidth_api.d.ts.map +1 -0
- package/bandwidth_api.js +8 -0
- package/bandwidth_api.js.map +1 -0
- package/broadcast.d.ts +20 -28
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +55 -38
- package/broadcast.js.map +1 -1
- package/connection/accept.d.ts +16 -1
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +39 -24
- package/connection/accept.js.map +1 -1
- package/connection/browser.d.ts.map +1 -1
- package/connection/browser.js +9 -7
- package/connection/browser.js.map +1 -1
- package/connection/connect.d.ts +30 -6
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +85 -45
- package/connection/connect.js.map +1 -1
- package/connection/established.d.ts +16 -21
- package/connection/established.d.ts.map +1 -1
- package/connection/established.js.map +1 -1
- package/connection/forward.d.ts +2 -0
- package/connection/forward.d.ts.map +1 -0
- package/connection/forward.js +159 -0
- package/connection/forward.js.map +1 -0
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +2 -2
- package/connection/handshake.js.map +1 -1
- package/connection/index.d.ts +5 -5
- package/connection/index.d.ts.map +1 -1
- package/connection/index.js +4 -5
- package/connection/index.js.map +1 -1
- package/connection/pool.d.ts +188 -0
- package/connection/pool.d.ts.map +1 -0
- package/connection/pool.js +351 -0
- package/connection/pool.js.map +1 -0
- package/connection/reload.d.ts +14 -93
- package/connection/reload.d.ts.map +1 -1
- package/connection/reload.js +216 -80
- package/connection/reload.js.map +1 -1
- package/connection/stats.d.ts +3 -26
- package/connection/stats.d.ts.map +1 -1
- package/connection/stats.js.map +1 -1
- package/connection/transport.d.ts +0 -7
- package/connection/transport.d.ts.map +1 -1
- package/consume.d.ts +1 -43
- package/consume.d.ts.map +1 -1
- package/consume.js +1 -1
- package/consume.js.map +1 -1
- package/error.d.ts +180 -29
- package/error.d.ts.map +1 -1
- package/error.js +310 -16
- package/error.js.map +1 -1
- package/errors.d.ts +7 -0
- package/errors.d.ts.map +1 -0
- package/errors.js +8 -0
- package/errors.js.map +1 -0
- package/group.d.ts +9 -43
- package/group.d.ts.map +1 -1
- package/group.js +283 -69
- package/group.js.map +1 -1
- package/hop.d.ts +107 -0
- package/hop.d.ts.map +1 -0
- package/hop.js +103 -0
- package/hop.js.map +1 -0
- package/ietf/aliases.d.ts +1 -78
- package/ietf/aliases.d.ts.map +1 -1
- package/ietf/cluster.d.ts +6 -120
- package/ietf/cluster.d.ts.map +1 -1
- package/ietf/cluster.js +81 -41
- package/ietf/cluster.js.map +1 -1
- package/ietf/connection.d.ts +6 -72
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +11 -47
- package/ietf/connection.js.map +1 -1
- package/ietf/error.d.ts +11 -0
- package/ietf/error.d.ts.map +1 -0
- package/ietf/error.js +168 -0
- package/ietf/error.js.map +1 -0
- package/ietf/filter.d.ts.map +1 -1
- package/ietf/filter.js +6 -1
- package/ietf/filter.js.map +1 -1
- package/ietf/goaway.d.ts.map +1 -1
- package/ietf/goaway.js +22 -5
- package/ietf/goaway.js.map +1 -1
- package/ietf/parameters.d.ts +2 -2
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +15 -17
- package/ietf/parameters.js.map +1 -1
- package/ietf/publish_namespace.d.ts +25 -0
- package/ietf/publish_namespace.d.ts.map +1 -1
- package/ietf/publish_namespace.js +63 -0
- package/ietf/publish_namespace.js.map +1 -1
- package/ietf/publisher.d.ts +1 -82
- package/ietf/publisher.d.ts.map +1 -1
- package/ietf/publisher.js +203 -136
- package/ietf/publisher.js.map +1 -1
- package/ietf/solicit.d.ts +1 -40
- package/ietf/solicit.d.ts.map +1 -1
- package/ietf/subscribe.d.ts +1 -5
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +8 -9
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscriber.d.ts +1 -65
- package/ietf/subscriber.d.ts.map +1 -1
- package/ietf/subscriber.js +154 -73
- package/ietf/subscriber.js.map +1 -1
- package/ietf/version.d.ts +12 -1
- package/ietf/version.d.ts.map +1 -1
- package/ietf/version.js +13 -0
- package/ietf/version.js.map +1 -1
- package/index.d.ts +11 -6
- package/index.d.ts.map +1 -1
- package/index.js +10 -5
- package/index.js.map +1 -1
- package/internal.d.ts +97 -1
- package/internal.d.ts.map +1 -1
- package/internal.js +65 -0
- package/internal.js.map +1 -1
- package/lite/announce.d.ts +15 -9
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +47 -20
- package/lite/announce.js.map +1 -1
- package/lite/connection.d.ts +9 -59
- package/lite/connection.d.ts.map +1 -1
- package/lite/connection.js +20 -32
- package/lite/connection.js.map +1 -1
- package/lite/fetch.d.ts +15 -1
- package/lite/fetch.d.ts.map +1 -1
- package/lite/fetch.js +39 -7
- package/lite/fetch.js.map +1 -1
- package/lite/goaway.d.ts.map +1 -1
- package/lite/goaway.js +7 -1
- package/lite/goaway.js.map +1 -1
- package/lite/group.d.ts +18 -4
- package/lite/group.d.ts.map +1 -1
- package/lite/group.js +31 -10
- package/lite/group.js.map +1 -1
- package/lite/priority.d.ts +1 -61
- package/lite/priority.d.ts.map +1 -1
- package/lite/priority.js +4 -5
- package/lite/priority.js.map +1 -1
- package/lite/publisher.d.ts +1 -69
- package/lite/publisher.d.ts.map +1 -1
- package/lite/publisher.js +507 -200
- package/lite/publisher.js.map +1 -1
- package/lite/setup.d.ts +7 -7
- package/lite/setup.d.ts.map +1 -1
- package/lite/setup.js +13 -13
- package/lite/setup.js.map +1 -1
- package/lite/subscribe.d.ts +61 -13
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +186 -44
- package/lite/subscribe.js.map +1 -1
- package/lite/subscriber.d.ts +8 -57
- package/lite/subscriber.d.ts.map +1 -1
- package/lite/subscriber.js +179 -117
- package/lite/subscriber.js.map +1 -1
- package/lite/track.d.ts +4 -10
- package/lite/track.d.ts.map +1 -1
- package/lite/track.js +34 -29
- package/lite/track.js.map +1 -1
- package/lite/version.d.ts +31 -6
- package/lite/version.d.ts.map +1 -1
- package/lite/version.js +71 -11
- package/lite/version.js.map +1 -1
- package/origin.d.ts +229 -29
- package/origin.d.ts.map +1 -1
- package/origin.js +1087 -37
- package/origin.js.map +1 -1
- package/package.json +3 -2
- package/path.d.ts +25 -7
- package/path.d.ts.map +1 -1
- package/path.js +5 -3
- package/path.js.map +1 -1
- package/stream.d.ts.map +1 -1
- package/stream.js +23 -14
- package/stream.js.map +1 -1
- package/time.d.ts +15 -2
- package/time.d.ts.map +1 -1
- package/time.js +28 -9
- package/time.js.map +1 -1
- package/track.d.ts +166 -83
- package/track.d.ts.map +1 -1
- package/track.js +617 -187
- package/track.js.map +1 -1
- package/wire.d.ts +67 -0
- package/wire.d.ts.map +1 -0
- package/wire.js +32 -0
- package/wire.js.map +1 -0
- package/zod.d.ts +1 -1
- package/zod.d.ts.map +1 -1
- package/zod.js.map +1 -1
- package/mock.d.ts +0 -66
- package/mock.d.ts.map +0 -1
- package/mock.js +0 -243
- package/mock.js.map +0 -1
package/lite/priority.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priority.js","sourceRoot":"","sources":["../../src/lite/priority.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,0FAA0F;AAC1F,0FAA0F;AAC1F,8FAA8F;AAC9F,+FAA+F;AAC/F,kCAAkC;AAClC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC;AAE3B,0DAA0D;AAC1D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,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjB,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;IAED;;;;;;OAMG;IACH,KAAK;QACJ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;YAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC/C,CAAC;IAED,qFAAqF;IACrF,yFAAyF;IACzF,UAAU;IACV,SAAS,CAAC,QAAgB;QACzB,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAC5C,IAAI,KAAK,GAAG,QAAQ;gBAAE,KAAK,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO;QACN,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,QAAQ,IAAI,CAAC,CAAC;QAChE,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChD,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACjF,CAAC;IACF,CAAC;CACD","sourcesContent":["/**\n * Stream prioritization for moq-lite, mirroring the Rust `lite::priority` queue.\n *\n * @module\n */\n\nimport type { Dispose } from \"@moq/signals\";\nimport type { Writer } from \"../stream.ts\";\nimport type * as track from \"../track.ts\";\n\n// The transport compares send orders as a single number, so the two ranks are packed into\n// disjoint ranges: the track priority takes the high bits so it always dominates, and the\n// position below it. Group data stays negative so protocol streams at the transport's default\n// order of 0 always make progress. A u8 priority and 44-bit position fill the negative half of\n// the safe integer range exactly.\nconst GROUP_SPAN = 2 ** 44;\n\n/** The highest track priority the wire carries (a u8). */\nconst MAX_PRIORITY = 0xff;\n\n/**\n * What to rank a group stream by.\n *\n * @internal\n */\nexport interface Rank {\n\t/** The subscriber's track priority, which outweighs everything below it. */\n\tpriority: number;\n\n\t/**\n\t * Where the group sits in the queue its own subscription wants sent, 0 being the one to\n\t * send next. Defaults to 0, which is right for a stream that is the only one of its kind.\n\t */\n\tposition?: number;\n}\n\n/**\n * The transport send order for a group, where HIGHER values are transmitted first.\n *\n * A higher `priority` always wins. Below it, a group is ranked by its `position` in its own\n * subscription rather than by its sequence, so two tracks at the same priority interleave:\n * each one's next group ties with the other's, whatever their group numbering. Comparing\n * sequences instead would let a track that had been running longer, or that numbered its\n * groups from a clock, starve one that started later.\n *\n * @internal\n */\nexport function sendOrder({ priority, position = 0 }: Rank): number {\n\treturn -((MAX_PRIORITY - clamp(priority, MAX_PRIORITY)) * GROUP_SPAN + clamp(position, GROUP_SPAN - 1) + 1);\n}\n\n// Both ranks are bounded: the priority by its wire type, the position by the space left below\n// it. Anything outside is a caller bug rather than a value worth preserving.\nfunction clamp(value: number, max: number): number {\n\treturn Math.min(Math.max(Math.trunc(value), 0), max);\n}\n\n/**\n * Ranks one subscription's group streams against each other, and re-ranks them whenever the\n * set changes or the subscription is updated.\n *\n * A group's rank is its position among the groups in flight, so which group goes first is\n * decided here rather than by arithmetic on sequence numbers. Newest first, always: under\n * congestion that sheds the backlog rather than the live edge, and a subscriber wanting\n * sequence order reorders locally rather than asking the wire for it.\n *\n * One listener covers the whole subscription. A listener per group would instead pile up on\n * it, and a track that stalls with many groups open would trip the signals leak guard.\n *\n * @internal\n */\nexport class Priority {\n\t#track: track.Subscriber;\n\t#streams = new Map<Writer, number>();\n\t#dispose: Dispose;\n\t#closed = false;\n\n\t/** Follow `track`'s subscription until {@link close}. */\n\tconstructor(track: track.Subscriber) {\n\t\tthis.#track = track;\n\t\tthis.#dispose = track.subscription.subscribe(() => this.#rerank());\n\t}\n\n\t/** The send order for a group at `sequence`, whether or not it has a stream yet. */\n\trank(sequence: number): number {\n\t\treturn sendOrder({\n\t\t\tpriority: this.#track.subscription.peek()?.priority ?? 0,\n\t\t\tposition: this.#position(sequence),\n\t\t});\n\t}\n\n\t/** Rank a group's stream now, and again whenever the ranking changes, until {@link remove}. */\n\tadd(stream: Writer, sequence: number) {\n\t\tthis.#streams.set(stream, sequence);\n\n\t\t// Also covers the stream itself: opening one can block on transport capacity, so an\n\t\t// update that landed while it did predates this registration.\n\t\tthis.#rerank();\n\t}\n\n\t/** Stop ranking a finished group's stream, promoting whatever was queued behind it. */\n\tremove(stream: Writer) {\n\t\tif (!this.#streams.delete(stream)) return;\n\n\t\tif (this.#closed && this.#streams.size === 0) {\n\t\t\tthis.#dispose();\n\t\t} else {\n\t\t\tthis.#rerank();\n\t\t}\n\t}\n\n\t/**\n\t * Stop taking new groups, and release the subscription listener once the last one leaves.\n\t *\n\t * The track can finish while several groups are still draining, and those are the ones the\n\t * subscriber is still waiting on. They keep being promoted as the groups ahead of them\n\t * finish, rather than being stranded at whatever position they held when the track ended.\n\t */\n\tclose() {\n\t\tthis.#closed = true;\n\t\tif (this.#streams.size === 0) this.#dispose();\n\t}\n\n\t// How many of this subscription's groups in flight should be sent before `sequence`.\n\t// Sequences are unique within a subscription, so a group already registered never counts\n\t// itself.\n\t#position(sequence: number): number {\n\t\tlet ahead = 0;\n\t\tfor (const other of this.#streams.values()) {\n\t\t\tif (other > sequence) ahead++;\n\t\t}\n\t\treturn ahead;\n\t}\n\n\t#rerank() {\n\t\tconst priority = this.#track.subscription.peek()?.priority ?? 0;\n\t\tfor (const [stream, sequence] of this.#streams) {\n\t\t\tstream.setPriority(sendOrder({ priority, position: this.#position(sequence) }));\n\t\t}\n\t}\n}\n"]}
|
package/lite/publisher.d.ts
CHANGED
|
@@ -1,70 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Origin } from "../origin";
|
|
3
|
-
import * as Path from "../path";
|
|
4
|
-
import { type Stream } from "../stream";
|
|
5
|
-
import { type AnnounceRequest } from "./announce";
|
|
6
|
-
import type { Fetch } from "./fetch";
|
|
7
|
-
import { type Subscribe } from "./subscribe";
|
|
8
|
-
import { type Track as TrackMessage } from "./track";
|
|
9
|
-
import { Version } from "./version";
|
|
10
|
-
/**
|
|
11
|
-
* Handles publishing broadcasts and managing their lifecycle.
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare class Publisher {
|
|
16
|
-
#private;
|
|
17
|
-
readonly version: Version;
|
|
18
|
-
readonly origin: Origin;
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new Publisher instance.
|
|
21
|
-
* @param quic - The WebTransport session to use
|
|
22
|
-
* @param version - Negotiated protocol version
|
|
23
|
-
* @param origin - Origin id shared with the Subscriber
|
|
24
|
-
*
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
constructor(quic: WebTransport, version: Version, origin: Origin);
|
|
28
|
-
/**
|
|
29
|
-
* Publishes a broadcast with any associated tracks.
|
|
30
|
-
* @param name - The broadcast to publish
|
|
31
|
-
*/
|
|
32
|
-
publish(path: Path.Valid, broadcast: broadcast.Producer): void;
|
|
33
|
-
/**
|
|
34
|
-
* Handles an announce interest message.
|
|
35
|
-
* @param msg - The announce interest message
|
|
36
|
-
* @param stream - The stream to write announcements to
|
|
37
|
-
*
|
|
38
|
-
* @internal
|
|
39
|
-
*/
|
|
40
|
-
runAnnounce(msg: AnnounceRequest, stream: Stream): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Handles a subscribe message.
|
|
43
|
-
* @param msg - The subscribe message
|
|
44
|
-
* @param stream - The stream to write track data to
|
|
45
|
-
*
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
runSubscribe(msg: Subscribe, stream: Stream): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Handles a FETCH stream by serving one group as bare frame records (lite-05+).
|
|
51
|
-
*
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
runFetch(msg: Fetch, stream: Stream): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Answers a TRACK stream (0x6) with a single TRACK_INFO, then FINs.
|
|
57
|
-
*
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
|
-
runTrackInfo(msg: TrackMessage, stream: Stream): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Handles a probe stream by periodically reporting estimated bitrate.
|
|
63
|
-
* @param stream - The probe bidi stream
|
|
64
|
-
*
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
runProbe(stream: Stream): Promise<void>;
|
|
68
|
-
close(): void;
|
|
69
|
-
}
|
|
1
|
+
export {};
|
|
70
2
|
//# sourceMappingURL=publisher.d.ts.map
|
package/lite/publisher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publisher.d.ts","sourceRoot":"","sources":["../../src/lite/publisher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publisher.d.ts","sourceRoot":"","sources":["../../src/lite/publisher.ts"],"names":[],"mappings":""}
|