@moq/net 0.4.8 → 0.22.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/README.md +7 -1
- package/announce.d.ts +1 -1
- package/announce.d.ts.map +1 -1
- package/announce.js +1 -1
- package/announce.js.map +1 -1
- package/announced.d.ts +51 -47
- package/announced.d.ts.map +1 -1
- package/announced.js +183 -31
- package/announced.js.map +1 -1
- package/announced.test-util.d.ts +2 -0
- package/announced.test-util.d.ts.map +1 -0
- package/announced.test-util.js +27 -0
- package/announced.test-util.js.map +1 -0
- package/auth.d.ts +64 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +20 -0
- package/auth.js.map +1 -0
- package/auth_gate.d.ts +2 -0
- package/auth_gate.d.ts.map +1 -0
- package/auth_gate.js +24 -0
- package/auth_gate.js.map +1 -0
- package/auth_session.d.ts +49 -0
- package/auth_session.d.ts.map +1 -0
- package/auth_session.js +1097 -0
- package/auth_session.js.map +1 -0
- package/bandwidth.d.ts +129 -25
- package/bandwidth.d.ts.map +1 -1
- package/bandwidth.js +410 -138
- package/bandwidth.js.map +1 -1
- package/bandwidth_api.d.ts +1 -1
- package/bandwidth_api.d.ts.map +1 -1
- package/bandwidth_api.js +1 -1
- package/bandwidth_api.js.map +1 -1
- package/broadcast.d.ts +62 -36
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +556 -172
- package/broadcast.js.map +1 -1
- package/cache.d.ts +103 -0
- package/cache.d.ts.map +1 -0
- package/cache.js +254 -0
- package/cache.js.map +1 -0
- package/claim.test-util.d.ts +5 -0
- package/claim.test-util.d.ts.map +1 -0
- package/claim.test-util.js +13 -0
- package/claim.test-util.js.map +1 -0
- package/connection/accept.d.ts +20 -12
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +97 -129
- package/connection/accept.js.map +1 -1
- package/connection/browser.d.ts.map +1 -1
- package/connection/browser.js +28 -19
- package/connection/browser.js.map +1 -1
- package/connection/connect.d.ts +119 -23
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +535 -216
- package/connection/connect.js.map +1 -1
- package/connection/dials.d.ts +45 -0
- package/connection/dials.d.ts.map +1 -0
- package/connection/dials.js +109 -0
- package/connection/dials.js.map +1 -0
- package/connection/endpoint.d.ts +60 -0
- package/connection/endpoint.d.ts.map +1 -0
- package/connection/endpoint.js +114 -0
- package/connection/endpoint.js.map +1 -0
- package/connection/forward.d.ts +7 -1
- package/connection/forward.d.ts.map +1 -1
- package/connection/forward.js +265 -80
- package/connection/forward.js.map +1 -1
- package/connection/goaway.d.ts +16 -9
- package/connection/goaway.d.ts.map +1 -1
- package/connection/goaway.js +22 -108
- package/connection/goaway.js.map +1 -1
- package/connection/handshake.d.ts +32 -6
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +97 -20
- package/connection/handshake.js.map +1 -1
- package/connection/index.d.ts +3 -6
- package/connection/index.d.ts.map +1 -1
- package/connection/index.js +1 -2
- package/connection/index.js.map +1 -1
- package/connection/liveness.d.ts +14 -0
- package/connection/liveness.d.ts.map +1 -0
- package/connection/liveness.js +30 -0
- package/connection/liveness.js.map +1 -0
- package/connection/pool.d.ts +137 -58
- package/connection/pool.d.ts.map +1 -1
- package/connection/pool.js +281 -117
- package/connection/pool.js.map +1 -1
- package/connection/reload.d.ts +60 -12
- package/connection/reload.d.ts.map +1 -1
- package/connection/reload.js +859 -233
- package/connection/reload.js.map +1 -1
- package/connection/session.d.ts +91 -0
- package/connection/session.d.ts.map +1 -0
- package/connection/session.js +2 -0
- package/connection/session.js.map +1 -0
- package/connection/stats.d.ts +20 -11
- package/connection/stats.d.ts.map +1 -1
- package/connection/stats.js +64 -8
- package/connection/stats.js.map +1 -1
- package/connection/ticker.d.ts +4 -0
- package/connection/ticker.d.ts.map +1 -0
- package/connection/ticker.js +66 -0
- package/connection/ticker.js.map +1 -0
- package/connection/tokens.d.ts +2 -0
- package/connection/tokens.d.ts.map +1 -0
- package/connection/tokens.js +404 -0
- package/connection/tokens.js.map +1 -0
- package/connection/transport.d.ts.map +1 -1
- package/connection/transport.js +4 -4
- package/connection/transport.js.map +1 -1
- package/connection/withdrawal.d.ts +2 -0
- package/connection/withdrawal.d.ts.map +1 -0
- package/connection/withdrawal.js +23 -0
- package/connection/withdrawal.js.map +1 -0
- package/consume.js +213 -46
- package/consume.js.map +1 -1
- package/cover.d.ts +59 -0
- package/cover.d.ts.map +1 -0
- package/cover.js +375 -0
- package/cover.js.map +1 -0
- package/datagram.d.ts +70 -11
- package/datagram.d.ts.map +1 -1
- package/datagram.js +317 -1
- package/datagram.js.map +1 -1
- package/datagram_stream.d.ts +18 -0
- package/datagram_stream.d.ts.map +1 -0
- package/datagram_stream.js +67 -0
- package/datagram_stream.js.map +1 -0
- package/defined.test-util.d.ts +2 -0
- package/defined.test-util.d.ts.map +1 -0
- package/defined.test-util.js +7 -0
- package/defined.test-util.js.map +1 -0
- package/delivered.d.ts +75 -0
- package/delivered.d.ts.map +1 -0
- package/delivered.js +228 -0
- package/delivered.js.map +1 -0
- package/demand.d.ts +173 -0
- package/demand.d.ts.map +1 -0
- package/demand.js +582 -0
- package/demand.js.map +1 -0
- package/drops.d.ts +93 -0
- package/drops.d.ts.map +1 -0
- package/drops.js +283 -0
- package/drops.js.map +1 -0
- package/error.d.ts +120 -21
- package/error.d.ts.map +1 -1
- package/error.js +230 -37
- package/error.js.map +1 -1
- package/errors.d.ts +2 -2
- package/errors.d.ts.map +1 -1
- package/errors.js +2 -2
- package/errors.js.map +1 -1
- package/fill.d.ts +174 -0
- package/fill.d.ts.map +1 -0
- package/fill.js +760 -0
- package/fill.js.map +1 -0
- package/flate/decoder.d.ts +2 -0
- package/flate/decoder.d.ts.map +1 -0
- package/flate/decoder.js +63 -0
- package/flate/decoder.js.map +1 -0
- package/flate/encoder.d.ts +2 -0
- package/flate/encoder.d.ts.map +1 -0
- package/flate/encoder.js +64 -0
- package/flate/encoder.js.map +1 -0
- package/flate/group.d.ts +34 -0
- package/flate/group.d.ts.map +1 -0
- package/flate/group.js +140 -0
- package/flate/group.js.map +1 -0
- package/frame.d.ts +80 -0
- package/frame.d.ts.map +1 -0
- package/frame.js +296 -0
- package/frame.js.map +1 -0
- package/frame.test-util.d.ts +5 -0
- package/frame.test-util.d.ts.map +1 -0
- package/frame.test-util.js +9 -0
- package/frame.test-util.js.map +1 -0
- package/group.d.ts +108 -45
- package/group.d.ts.map +1 -1
- package/group.js +1616 -307
- package/group.js.map +1 -1
- package/group_api.d.ts +7 -0
- package/group_api.d.ts.map +1 -0
- package/group_api.js +7 -0
- package/group_api.js.map +1 -0
- package/hop.d.ts +62 -76
- package/hop.d.ts.map +1 -1
- package/hop.js +92 -64
- package/hop.js.map +1 -1
- package/identity.d.ts +39 -0
- package/identity.d.ts.map +1 -0
- package/identity.js +47 -0
- package/identity.js.map +1 -0
- package/ietf/active_count.d.ts +2 -0
- package/ietf/active_count.d.ts.map +1 -0
- package/ietf/active_count.js +30 -0
- package/ietf/active_count.js.map +1 -0
- package/ietf/aliases.js +69 -35
- package/ietf/aliases.js.map +1 -1
- package/ietf/cluster.d.ts +3 -3
- package/ietf/cluster.js +14 -62
- package/ietf/cluster.js.map +1 -1
- package/ietf/connection.d.ts +1 -31
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +305 -143
- package/ietf/connection.js.map +1 -1
- package/ietf/datagram.d.ts +60 -0
- package/ietf/datagram.d.ts.map +1 -0
- package/ietf/datagram.js +152 -0
- package/ietf/datagram.js.map +1 -0
- package/ietf/error.d.ts +3 -3
- package/ietf/error.js +82 -100
- package/ietf/error.js.map +1 -1
- package/ietf/fetch.d.ts +91 -35
- package/ietf/fetch.d.ts.map +1 -1
- package/ietf/fetch.js +172 -93
- package/ietf/fetch.js.map +1 -1
- package/ietf/filter.d.ts +20 -30
- package/ietf/filter.d.ts.map +1 -1
- package/ietf/filter.js +140 -171
- package/ietf/filter.js.map +1 -1
- package/ietf/goaway.d.ts +11 -9
- package/ietf/goaway.d.ts.map +1 -1
- package/ietf/goaway.js +22 -35
- package/ietf/goaway.js.map +1 -1
- package/ietf/hidden.js +1 -1
- package/ietf/hidden.js.map +1 -1
- package/ietf/index.d.ts +2 -14
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +4 -14
- package/ietf/index.js.map +1 -1
- package/ietf/join.d.ts +7 -0
- package/ietf/join.d.ts.map +1 -0
- package/ietf/join.js +234 -0
- package/ietf/join.js.map +1 -0
- package/ietf/message.d.ts +18 -2
- package/ietf/message.d.ts.map +1 -1
- package/ietf/message.js +60 -40
- package/ietf/message.js.map +1 -1
- package/ietf/message.test-util.d.ts +6 -0
- package/ietf/message.test-util.d.ts.map +1 -0
- package/ietf/message.test-util.js +13 -0
- package/ietf/message.test-util.js.map +1 -0
- package/ietf/namespace.d.ts +17 -3
- package/ietf/namespace.d.ts.map +1 -1
- package/ietf/namespace.js +78 -26
- package/ietf/namespace.js.map +1 -1
- package/ietf/object.d.ts +194 -32
- package/ietf/object.d.ts.map +1 -1
- package/ietf/object.js +405 -178
- package/ietf/object.js.map +1 -1
- package/ietf/parameters.d.ts +22 -42
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +260 -472
- package/ietf/parameters.js.map +1 -1
- package/ietf/priority.d.ts +17 -2
- package/ietf/priority.d.ts.map +1 -1
- package/ietf/priority.js +19 -4
- package/ietf/priority.js.map +1 -1
- package/ietf/properties.d.ts +5 -4
- package/ietf/properties.d.ts.map +1 -1
- package/ietf/properties.js +78 -48
- package/ietf/properties.js.map +1 -1
- package/ietf/publish.d.ts +22 -30
- package/ietf/publish.d.ts.map +1 -1
- package/ietf/publish.js +45 -139
- package/ietf/publish.js.map +1 -1
- package/ietf/publish_namespace.d.ts +46 -69
- package/ietf/publish_namespace.d.ts.map +1 -1
- package/ietf/publish_namespace.js +66 -184
- package/ietf/publish_namespace.js.map +1 -1
- package/ietf/publisher.js +1800 -600
- package/ietf/publisher.js.map +1 -1
- package/ietf/range.d.ts +2 -0
- package/ietf/range.d.ts.map +1 -0
- package/ietf/range.js +222 -0
- package/ietf/range.js.map +1 -0
- package/ietf/request.d.ts +3 -27
- package/ietf/request.d.ts.map +1 -1
- package/ietf/request.js +41 -78
- package/ietf/request.js.map +1 -1
- package/ietf/request_stream.d.ts +1 -6
- package/ietf/request_stream.d.ts.map +1 -1
- package/ietf/request_stream.js +306 -16
- package/ietf/request_stream.js.map +1 -1
- package/ietf/session.d.ts +41 -0
- package/ietf/session.d.ts.map +1 -0
- package/ietf/session.js +65 -0
- package/ietf/session.js.map +1 -0
- package/ietf/setup.d.ts +4 -29
- package/ietf/setup.d.ts.map +1 -1
- package/ietf/setup.js +6 -117
- package/ietf/setup.js.map +1 -1
- package/ietf/setup_options.d.ts +31 -0
- package/ietf/setup_options.d.ts.map +1 -0
- package/ietf/setup_options.js +138 -0
- package/ietf/setup_options.js.map +1 -0
- package/ietf/solicit.js +4 -14
- package/ietf/solicit.js.map +1 -1
- package/ietf/subscribe.d.ts +48 -41
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +118 -239
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscribe_namespace.d.ts +13 -76
- package/ietf/subscribe_namespace.d.ts.map +1 -1
- package/ietf/subscribe_namespace.js +30 -201
- package/ietf/subscribe_namespace.js.map +1 -1
- package/ietf/subscriber.js +1839 -536
- package/ietf/subscriber.js.map +1 -1
- package/ietf/token.js +105 -27
- package/ietf/token.js.map +1 -1
- package/ietf/track.d.ts +25 -22
- package/ietf/track.d.ts.map +1 -1
- package/ietf/track.js +48 -61
- package/ietf/track.js.map +1 -1
- package/ietf/version.d.ts +13 -42
- package/ietf/version.d.ts.map +1 -1
- package/ietf/version.js +22 -48
- package/ietf/version.js.map +1 -1
- package/implementation.d.ts +2 -0
- package/implementation.d.ts.map +1 -0
- package/implementation.js +5 -0
- package/implementation.js.map +1 -0
- package/index.d.ts +25 -10
- package/index.d.ts.map +1 -1
- package/index.js +19 -6
- package/index.js.map +1 -1
- package/internal.d.ts +1512 -64
- package/internal.d.ts.map +1 -1
- package/internal.js +557 -79
- package/internal.js.map +1 -1
- package/ledger.d.ts +23 -0
- package/ledger.d.ts.map +1 -0
- package/ledger.js +247 -0
- package/ledger.js.map +1 -0
- package/listing.d.ts +132 -0
- package/listing.d.ts.map +1 -0
- package/listing.js +486 -0
- package/listing.js.map +1 -0
- package/lite/announce.d.ts +124 -63
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +384 -158
- package/lite/announce.js.map +1 -1
- package/lite/announce_stream.d.ts +2 -0
- package/lite/announce_stream.d.ts.map +1 -0
- package/lite/announce_stream.js +92 -0
- package/lite/announce_stream.js.map +1 -0
- package/lite/answer.d.ts +22 -0
- package/lite/answer.d.ts.map +1 -0
- package/lite/answer.js +301 -0
- package/lite/answer.js.map +1 -0
- package/lite/auth.d.ts +45 -0
- package/lite/auth.d.ts.map +1 -0
- package/lite/auth.js +204 -0
- package/lite/auth.js.map +1 -0
- package/lite/compat.d.ts +31 -0
- package/lite/compat.d.ts.map +1 -0
- package/lite/compat.js +86 -0
- package/lite/compat.js.map +1 -0
- package/lite/connection.d.ts +1 -45
- package/lite/connection.d.ts.map +1 -1
- package/lite/connection.js +360 -77
- package/lite/connection.js.map +1 -1
- package/lite/datagram-end.d.ts +26 -0
- package/lite/datagram-end.d.ts.map +1 -0
- package/lite/datagram-end.js +30 -0
- package/lite/datagram-end.js.map +1 -0
- package/lite/datagram.d.ts +73 -8
- package/lite/datagram.d.ts.map +1 -1
- package/lite/datagram.js +144 -9
- package/lite/datagram.js.map +1 -1
- package/lite/duration.d.ts +6 -0
- package/lite/duration.d.ts.map +1 -0
- package/lite/duration.js +14 -0
- package/lite/duration.js.map +1 -0
- package/lite/error.d.ts +9 -0
- package/lite/error.d.ts.map +1 -0
- package/lite/error.js +24 -0
- package/lite/error.js.map +1 -0
- package/lite/fills.d.ts +162 -0
- package/lite/fills.d.ts.map +1 -0
- package/lite/fills.js +486 -0
- package/lite/fills.js.map +1 -0
- package/lite/fit.d.ts +49 -0
- package/lite/fit.d.ts.map +1 -0
- package/lite/fit.js +305 -0
- package/lite/fit.js.map +1 -0
- package/lite/goaway.d.ts +1 -1
- package/lite/goaway.d.ts.map +1 -1
- package/lite/goaway.js +5 -13
- package/lite/goaway.js.map +1 -1
- package/lite/group.d.ts +64 -13
- package/lite/group.d.ts.map +1 -1
- package/lite/group.js +108 -30
- package/lite/group.js.map +1 -1
- package/lite/identity.d.ts +25 -0
- package/lite/identity.d.ts.map +1 -0
- package/lite/identity.js +79 -0
- package/lite/identity.js.map +1 -0
- package/lite/index.d.ts +2 -1
- package/lite/index.d.ts.map +1 -1
- package/lite/index.js +2 -1
- package/lite/index.js.map +1 -1
- package/lite/message.d.ts +9 -1
- package/lite/message.d.ts.map +1 -1
- package/lite/message.js +28 -44
- package/lite/message.js.map +1 -1
- package/lite/priority.d.ts +9 -2
- package/lite/priority.d.ts.map +1 -1
- package/lite/priority.js +11 -105
- package/lite/priority.js.map +1 -1
- package/lite/probe.d.ts.map +1 -1
- package/lite/probe.js +9 -0
- package/lite/probe.js.map +1 -1
- package/lite/publisher.d.ts +10 -1
- package/lite/publisher.d.ts.map +1 -1
- package/lite/publisher.js +2548 -437
- package/lite/publisher.js.map +1 -1
- package/lite/routed.d.ts +59 -0
- package/lite/routed.d.ts.map +1 -0
- package/lite/routed.js +564 -0
- package/lite/routed.js.map +1 -0
- package/lite/session.d.ts +1 -27
- package/lite/session.d.ts.map +1 -1
- package/lite/session.js +0 -99
- package/lite/session.js.map +1 -1
- package/lite/setup.d.ts +29 -2
- package/lite/setup.d.ts.map +1 -1
- package/lite/setup.js +95 -21
- package/lite/setup.js.map +1 -1
- package/lite/stream.d.ts +5 -11
- package/lite/stream.d.ts.map +1 -1
- package/lite/stream.js +5 -1
- package/lite/stream.js.map +1 -1
- package/lite/subscribe.d.ts +475 -75
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +1373 -142
- package/lite/subscribe.js.map +1 -1
- package/lite/subscriber.d.ts +7 -44
- package/lite/subscriber.d.ts.map +1 -1
- package/lite/subscriber.js +3290 -515
- package/lite/subscriber.js.map +1 -1
- package/lite/track.d.ts +24 -9
- package/lite/track.d.ts.map +1 -1
- package/lite/track.js +116 -37
- package/lite/track.js.map +1 -1
- package/lite/tracks.d.ts +55 -0
- package/lite/tracks.d.ts.map +1 -0
- package/lite/tracks.js +114 -0
- package/lite/tracks.js.map +1 -0
- package/lite/version.d.ts +132 -24
- package/lite/version.d.ts.map +1 -1
- package/lite/version.js +378 -33
- package/lite/version.js.map +1 -1
- package/meta.d.ts +77 -0
- package/meta.d.ts.map +1 -0
- package/meta.js +130 -0
- package/meta.js.map +1 -0
- package/meta_api.d.ts +7 -0
- package/meta_api.d.ts.map +1 -0
- package/meta_api.js +7 -0
- package/meta_api.js.map +1 -0
- package/mint.d.ts +28 -0
- package/mint.d.ts.map +1 -0
- package/mint.js +66 -0
- package/mint.js.map +1 -0
- package/open.d.ts +63 -0
- package/open.d.ts.map +1 -0
- package/open.js +250 -0
- package/open.js.map +1 -0
- package/origin.d.ts +392 -140
- package/origin.d.ts.map +1 -1
- package/origin.js +2533 -686
- package/origin.js.map +1 -1
- package/package.json +8 -13
- package/path.d.ts +51 -51
- package/path.d.ts.map +1 -1
- package/path.js +210 -57
- package/path.js.map +1 -1
- package/payload.d.ts +33 -0
- package/payload.d.ts.map +1 -0
- package/payload.js +65 -0
- package/payload.js.map +1 -0
- package/prefix.d.ts +152 -0
- package/prefix.d.ts.map +1 -0
- package/prefix.js +349 -0
- package/prefix.js.map +1 -0
- package/priority.d.ts +8 -0
- package/priority.d.ts.map +1 -0
- package/priority.js +185 -0
- package/priority.js.map +1 -0
- package/queue.d.ts +2 -0
- package/queue.d.ts.map +1 -0
- package/queue.js +46 -0
- package/queue.js.map +1 -0
- package/ranges.d.ts +36 -0
- package/ranges.d.ts.map +1 -0
- package/ranges.js +312 -0
- package/ranges.js.map +1 -0
- package/rescale.d.ts +24 -0
- package/rescale.d.ts.map +1 -0
- package/rescale.js +39 -0
- package/rescale.js.map +1 -0
- package/resume.d.ts +55 -0
- package/resume.d.ts.map +1 -0
- package/resume.js +4173 -0
- package/resume.js.map +1 -0
- package/resume.test-util.d.ts +2 -0
- package/resume.test-util.d.ts.map +1 -0
- package/resume.test-util.js +25 -0
- package/resume.test-util.js.map +1 -0
- package/skips.d.ts +48 -0
- package/skips.d.ts.map +1 -0
- package/skips.js +182 -0
- package/skips.js.map +1 -0
- package/stream.d.ts +75 -37
- package/stream.d.ts.map +1 -1
- package/stream.js +236 -92
- package/stream.js.map +1 -1
- package/subscription.test-util.d.ts +2 -0
- package/subscription.test-util.d.ts.map +1 -0
- package/subscription.test-util.js +49 -0
- package/subscription.test-util.js.map +1 -0
- package/tail.d.ts +23 -14
- package/tail.d.ts.map +1 -1
- package/tail.js +224 -97
- package/tail.js.map +1 -1
- package/time.d.ts +41 -102
- package/time.d.ts.map +1 -1
- package/time.js +129 -91
- package/time.js.map +1 -1
- package/timed.d.ts +21 -0
- package/timed.d.ts.map +1 -0
- package/timed.js +2 -0
- package/timed.js.map +1 -0
- package/track.d.ts +577 -245
- package/track.d.ts.map +1 -1
- package/track.js +7306 -771
- package/track.js.map +1 -1
- package/track_api.d.ts +7 -0
- package/track_api.d.ts.map +1 -0
- package/track_api.js +7 -0
- package/track_api.js.map +1 -0
- package/util/abort.d.ts +1 -0
- package/util/abort.d.ts.map +1 -1
- package/util/abort.js +23 -1
- package/util/abort.js.map +1 -1
- package/util/announce.d.ts +4 -0
- package/util/announce.d.ts.map +1 -0
- package/util/announce.js +11 -0
- package/util/announce.js.map +1 -0
- package/util/bigint.d.ts +3 -0
- package/util/bigint.d.ts.map +1 -0
- package/util/bigint.js +8 -0
- package/util/bigint.js.map +1 -0
- package/util/change.d.ts +12 -0
- package/util/change.d.ts.map +1 -0
- package/util/change.js +18 -0
- package/util/change.js.map +1 -0
- package/util/deadline.d.ts +2 -0
- package/util/deadline.d.ts.map +1 -0
- package/util/deadline.js +108 -0
- package/util/deadline.js.map +1 -0
- package/util/decode_error.d.ts +3 -0
- package/util/decode_error.d.ts.map +1 -0
- package/util/decode_error.js +11 -0
- package/util/decode_error.js.map +1 -0
- package/util/demand.d.ts +8 -0
- package/util/demand.d.ts.map +1 -0
- package/util/demand.js +24 -0
- package/util/demand.js.map +1 -0
- package/util/given_up.d.ts +2 -0
- package/util/given_up.d.ts.map +1 -0
- package/util/given_up.js +101 -0
- package/util/given_up.js.map +1 -0
- package/util/hex.d.ts +6 -0
- package/util/hex.d.ts.map +1 -1
- package/util/hex.js +19 -4
- package/util/hex.js.map +1 -1
- package/util/key.d.ts +15 -0
- package/util/key.d.ts.map +1 -0
- package/util/key.js +38 -0
- package/util/key.js.map +1 -0
- package/util/limits.d.ts +2 -0
- package/util/limits.d.ts.map +1 -0
- package/util/limits.js +76 -0
- package/util/limits.js.map +1 -0
- package/util/observed.d.ts +23 -0
- package/util/observed.d.ts.map +1 -0
- package/util/observed.js +122 -0
- package/util/observed.js.map +1 -0
- package/util/sorted.d.ts +2 -0
- package/util/sorted.d.ts.map +1 -0
- package/util/sorted.js +149 -0
- package/util/sorted.js.map +1 -0
- package/util/timeout.d.ts +2 -1
- package/util/timeout.d.ts.map +1 -1
- package/util/timeout.js +13 -9
- package/util/timeout.js.map +1 -1
- package/util/timer.d.ts +2 -0
- package/util/timer.d.ts.map +1 -0
- package/util/timer.js +19 -0
- package/util/timer.js.map +1 -0
- package/util/utf8.d.ts +2 -0
- package/util/utf8.d.ts.map +1 -1
- package/util/utf8.js +7 -1
- package/util/utf8.js.map +1 -1
- package/util/varint.d.ts.map +1 -1
- package/util/varint.js +8 -1
- package/util/varint.js.map +1 -1
- package/util/watch.d.ts +8 -0
- package/util/watch.d.ts.map +1 -0
- package/util/watch.js +38 -0
- package/util/watch.js.map +1 -0
- package/util/yield.d.ts +2 -0
- package/util/yield.d.ts.map +1 -0
- package/util/yield.js +31 -0
- package/util/yield.js.map +1 -0
- package/varint.d.ts +0 -29
- package/varint.d.ts.map +1 -1
- package/varint.js +7 -28
- package/varint.js.map +1 -1
- package/varint_api.d.ts +7 -0
- package/varint_api.d.ts.map +1 -0
- package/varint_api.js +7 -0
- package/varint_api.js.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +4 -0
- package/version.js.map +1 -0
- package/window.d.ts +570 -0
- package/window.d.ts.map +1 -0
- package/window.js +1677 -0
- package/window.js.map +1 -0
- package/wire.d.ts +145 -30
- package/wire.d.ts.map +1 -1
- package/wire.js +27 -0
- package/wire.js.map +1 -1
- package/connection/established.d.ts +0 -53
- package/connection/established.d.ts.map +0 -1
- package/connection/established.js +0 -2
- package/connection/established.js.map +0 -1
- package/ietf/adapter.d.ts +0 -75
- package/ietf/adapter.d.ts.map +0 -1
- package/ietf/adapter.js +0 -699
- package/ietf/adapter.js.map +0 -1
- package/lite/datagram_stream.d.ts +0 -8
- package/lite/datagram_stream.d.ts.map +0 -1
- package/lite/datagram_stream.js +0 -43
- package/lite/datagram_stream.js.map +0 -1
- package/lite/fetch.d.ts +0 -28
- package/lite/fetch.d.ts.map +0 -1
- package/lite/fetch.js +0 -78
- package/lite/fetch.js.map +0 -1
- package/util/log.d.ts +0 -5
- package/util/log.d.ts.map +0 -1
- package/util/log.js +0 -16
- package/util/log.js.map +0 -1
- package/zod.d.ts +0 -13
- package/zod.d.ts.map +0 -1
- package/zod.js +0 -18
- package/zod.js.map +0 -1
package/frame.js
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { Once, race, Signal } from "@moq/signals";
|
|
2
|
+
import { StreamCode, StreamError } from "./error.js";
|
|
3
|
+
import { stored } from "./flate/group.js";
|
|
4
|
+
import { hooks } from "./internal.js";
|
|
5
|
+
import { Queue } from "./queue.js";
|
|
6
|
+
import { SEGMENT_BYTES } from "./util/limits.js";
|
|
7
|
+
// A frame written in pieces, shared by its group and every mirror. Written whole, it stays the
|
|
8
|
+
// writer's one buffer; otherwise it is one buffer within a segment, or a chain of
|
|
9
|
+
// `SEGMENT_BYTES` segments, each allocated by its first byte. Sealed segments shed from the
|
|
10
|
+
// front under the group's tail budget, so a reader that falls behind inside it is `Evicted`.
|
|
11
|
+
/** @internal */
|
|
12
|
+
export class Chunked {
|
|
13
|
+
size;
|
|
14
|
+
timestamp;
|
|
15
|
+
created;
|
|
16
|
+
// Bytes written so far, which a streaming reader waits on.
|
|
17
|
+
written = new Signal(0);
|
|
18
|
+
// Settled once every byte is written (`null`), or with the failure that cut the frame short.
|
|
19
|
+
done = new Once();
|
|
20
|
+
// The frame offset of the first retained segment.
|
|
21
|
+
base = 0;
|
|
22
|
+
// Allocated bytes across the retained segments.
|
|
23
|
+
retained = 0;
|
|
24
|
+
#segments = new Queue();
|
|
25
|
+
// Whether one write carried the whole frame, which is then a single buffer of any size.
|
|
26
|
+
#whole = false;
|
|
27
|
+
constructor(info) {
|
|
28
|
+
this.size = info.size;
|
|
29
|
+
this.timestamp = info.timestamp;
|
|
30
|
+
}
|
|
31
|
+
// Append `chunk`, returning the bytes newly allocated for it.
|
|
32
|
+
write(chunk) {
|
|
33
|
+
let at = this.written.peek();
|
|
34
|
+
if (at === 0 && chunk.byteLength === this.size) {
|
|
35
|
+
this.#whole = true;
|
|
36
|
+
this.#segments.push(chunk);
|
|
37
|
+
this.retained += chunk.byteLength;
|
|
38
|
+
this.written.set(this.size);
|
|
39
|
+
return chunk.byteLength;
|
|
40
|
+
}
|
|
41
|
+
let allocated = 0;
|
|
42
|
+
let offset = 0;
|
|
43
|
+
while (offset < chunk.byteLength) {
|
|
44
|
+
// The open segment ends at the next segment boundary, or the frame's end.
|
|
45
|
+
if (at % SEGMENT_BYTES === 0) {
|
|
46
|
+
const segment = new Uint8Array(Math.min(SEGMENT_BYTES, this.size - at));
|
|
47
|
+
this.#segments.push(segment);
|
|
48
|
+
this.retained += segment.byteLength;
|
|
49
|
+
allocated += segment.byteLength;
|
|
50
|
+
}
|
|
51
|
+
const segment = this.#segments.last;
|
|
52
|
+
const start = at % SEGMENT_BYTES;
|
|
53
|
+
const n = Math.min(chunk.byteLength - offset, segment.byteLength - start);
|
|
54
|
+
segment.set(chunk.subarray(offset, offset + n), start);
|
|
55
|
+
offset += n;
|
|
56
|
+
at += n;
|
|
57
|
+
}
|
|
58
|
+
this.written.set(at);
|
|
59
|
+
return allocated;
|
|
60
|
+
}
|
|
61
|
+
// The written bytes from frame offset `at` to the end of its segment, as a view.
|
|
62
|
+
chunk(at) {
|
|
63
|
+
const written = this.written.peek();
|
|
64
|
+
if (this.#whole) {
|
|
65
|
+
const whole = this.#segments.first;
|
|
66
|
+
return at === 0 ? whole : whole.subarray(at, written);
|
|
67
|
+
}
|
|
68
|
+
const index = Math.floor(at / SEGMENT_BYTES);
|
|
69
|
+
const segment = this.#segments.at(index - this.base / SEGMENT_BYTES);
|
|
70
|
+
const start = index * SEGMENT_BYTES;
|
|
71
|
+
return segment.subarray(at - start, Math.min(segment.byteLength, written - start));
|
|
72
|
+
}
|
|
73
|
+
// Drop the oldest sealed segment, returning its bytes, or 0 when only the newest is left.
|
|
74
|
+
shed() {
|
|
75
|
+
if (this.#segments.length <= 1)
|
|
76
|
+
return 0;
|
|
77
|
+
const segment = this.#segments.shift();
|
|
78
|
+
this.base += segment.byteLength;
|
|
79
|
+
this.retained -= segment.byteLength;
|
|
80
|
+
return segment.byteLength;
|
|
81
|
+
}
|
|
82
|
+
// Release every segment once the group lets go of the frame.
|
|
83
|
+
release() {
|
|
84
|
+
this.#segments = new Queue();
|
|
85
|
+
this.base = this.size;
|
|
86
|
+
this.retained = 0;
|
|
87
|
+
}
|
|
88
|
+
get payload() {
|
|
89
|
+
const done = this.done.peek();
|
|
90
|
+
if (done instanceof Error)
|
|
91
|
+
throw done;
|
|
92
|
+
if (done === undefined)
|
|
93
|
+
throw new Error("frame is still being written");
|
|
94
|
+
if (this.base > 0)
|
|
95
|
+
throw evicted();
|
|
96
|
+
if (this.#segments.length === 1)
|
|
97
|
+
return this.chunk(0);
|
|
98
|
+
const out = new Uint8Array(this.size);
|
|
99
|
+
let offset = 0;
|
|
100
|
+
for (const segment of this.#segments) {
|
|
101
|
+
out.set(segment, offset);
|
|
102
|
+
offset += segment.byteLength;
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// The payload size, without joining a chunked frame's segments.
|
|
108
|
+
/** @internal */
|
|
109
|
+
export function payloadBytes(frame) {
|
|
110
|
+
if (frame instanceof Chunked)
|
|
111
|
+
return frame.size;
|
|
112
|
+
return stored(frame)?.payload.length ?? frame.payload.byteLength;
|
|
113
|
+
}
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const EMPTY = new Uint8Array(0);
|
|
116
|
+
/** @internal */
|
|
117
|
+
export function evicted() {
|
|
118
|
+
return new StreamError(StreamCode.Evicted, { message: "group front was evicted" });
|
|
119
|
+
}
|
|
120
|
+
/** @internal */
|
|
121
|
+
export let makeProducer;
|
|
122
|
+
/**
|
|
123
|
+
* Writes one frame's payload in pieces, as Rust's `frame::Producer`. Obtain one from
|
|
124
|
+
* `Group.Producer.createFrame`.
|
|
125
|
+
*
|
|
126
|
+
* The writes must add up to the declared size exactly, and {@link finish} commits the frame.
|
|
127
|
+
* Its group takes no other frame until then; ending the group first fails the frame.
|
|
128
|
+
*
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export class Producer {
|
|
132
|
+
/** The declared payload size in bytes. */
|
|
133
|
+
size;
|
|
134
|
+
/** The frame's presentation timestamp, or on a scale-less track its group's key. */
|
|
135
|
+
timestamp;
|
|
136
|
+
#ops;
|
|
137
|
+
#done = false;
|
|
138
|
+
constructor(info, ops) {
|
|
139
|
+
this.size = info.size;
|
|
140
|
+
this.timestamp = info.timestamp;
|
|
141
|
+
this.#ops = ops;
|
|
142
|
+
}
|
|
143
|
+
static {
|
|
144
|
+
makeProducer = (info, ops) => new Producer(info, ops);
|
|
145
|
+
hooks.abortFrame = (frame, error) => frame.#fail(error);
|
|
146
|
+
}
|
|
147
|
+
/** Bytes still needed to complete the frame. */
|
|
148
|
+
get remaining() {
|
|
149
|
+
return this.size - this.#ops.written();
|
|
150
|
+
}
|
|
151
|
+
/** Append `chunk`, waking readers streaming the frame. The bytes are copied unless one write carries the whole frame. */
|
|
152
|
+
write(chunk) {
|
|
153
|
+
if (this.#done)
|
|
154
|
+
throw new Error("frame is closed");
|
|
155
|
+
if (chunk.byteLength > this.remaining)
|
|
156
|
+
throw new RangeError("write exceeds the frame's declared size");
|
|
157
|
+
if (chunk.byteLength > 0)
|
|
158
|
+
this.#ops.write(chunk);
|
|
159
|
+
}
|
|
160
|
+
/** Commit the frame once every declared byte is written, returning its group to write the rest. */
|
|
161
|
+
finish() {
|
|
162
|
+
if (this.#done)
|
|
163
|
+
throw new Error("frame is closed");
|
|
164
|
+
if (this.remaining !== 0)
|
|
165
|
+
throw new RangeError(`frame is ${this.remaining} bytes short of its declared size`);
|
|
166
|
+
this.#done = true;
|
|
167
|
+
return this.#ops.finish();
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Give the frame and its group up for now, as {@link GroupProducer.abort} does. A no-op once the
|
|
171
|
+
* frame finished or aborted. Mirrors the Rust `frame::Producer::abort`.
|
|
172
|
+
*/
|
|
173
|
+
// fallow-ignore-next-line unused-class-member
|
|
174
|
+
abort() {
|
|
175
|
+
this.#fail(new StreamError(StreamCode.Cancel, { message: "frame aborted" }));
|
|
176
|
+
}
|
|
177
|
+
#fail(error) {
|
|
178
|
+
if (this.#done)
|
|
179
|
+
return;
|
|
180
|
+
this.#done = true;
|
|
181
|
+
this.#ops.abort(error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/** @internal */
|
|
185
|
+
export let makeConsumer;
|
|
186
|
+
// The next chunk without waiting: `undefined` at the end, or `WAIT` until the next write.
|
|
187
|
+
/** @internal */
|
|
188
|
+
export let pollChunk;
|
|
189
|
+
// What a waiting chunk read waits on.
|
|
190
|
+
/** @internal */
|
|
191
|
+
export let chunkChanged;
|
|
192
|
+
/** @internal */
|
|
193
|
+
export const WAIT = Symbol("wait");
|
|
194
|
+
// Parts read in order, joined into one buffer, copied only when there is more than one.
|
|
195
|
+
/** @internal */
|
|
196
|
+
export function joined(parts, size) {
|
|
197
|
+
if (parts.length === 1)
|
|
198
|
+
return parts[0];
|
|
199
|
+
const out = new Uint8Array(size);
|
|
200
|
+
let at = 0;
|
|
201
|
+
for (const part of parts) {
|
|
202
|
+
out.set(part, at);
|
|
203
|
+
at += part.byteLength;
|
|
204
|
+
}
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Reads one frame's payload as it arrives, as Rust's `frame::Consumer`. Obtain one from
|
|
209
|
+
* `Group.Consumer.nextFrame`.
|
|
210
|
+
*
|
|
211
|
+
* Chunks are read-only views shared with other readers. A frame larger than its group's
|
|
212
|
+
* retained tail sheds its oldest segments while it is written, so a reader that falls that
|
|
213
|
+
* far behind fails with a `StreamError` of code `Evicted`.
|
|
214
|
+
*
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
export class Consumer {
|
|
218
|
+
/** The frame's index within its group, counting from 0 in write order. */
|
|
219
|
+
index;
|
|
220
|
+
/** The payload size in bytes. */
|
|
221
|
+
size;
|
|
222
|
+
/** The frame's presentation timestamp, or on a scale-less track its group's key. */
|
|
223
|
+
timestamp;
|
|
224
|
+
#frame;
|
|
225
|
+
#offset = 0;
|
|
226
|
+
constructor(index, frame) {
|
|
227
|
+
this.index = index;
|
|
228
|
+
this.#frame = frame;
|
|
229
|
+
this.size = payloadBytes(frame);
|
|
230
|
+
this.timestamp = frame.timestamp;
|
|
231
|
+
}
|
|
232
|
+
static {
|
|
233
|
+
makeConsumer = (index, frame) => new Consumer(index, frame);
|
|
234
|
+
hooks.readFrameChunk = (consumer, closed) => consumer.#readChunk(closed);
|
|
235
|
+
pollChunk = (consumer) => consumer.#poll();
|
|
236
|
+
chunkChanged = (consumer) => {
|
|
237
|
+
const frame = consumer.#frame;
|
|
238
|
+
return frame instanceof Chunked ? [frame.written, frame.done] : [];
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** When the frame's last byte landed in this node's group; `undefined` until then. */
|
|
242
|
+
get created() {
|
|
243
|
+
return this.#frame.created;
|
|
244
|
+
}
|
|
245
|
+
#poll() {
|
|
246
|
+
const frame = this.#frame;
|
|
247
|
+
if (!(frame instanceof Chunked)) {
|
|
248
|
+
if (this.#offset >= this.size)
|
|
249
|
+
return undefined;
|
|
250
|
+
this.#offset = this.size;
|
|
251
|
+
return frame.payload;
|
|
252
|
+
}
|
|
253
|
+
const done = frame.done.peek();
|
|
254
|
+
if (done instanceof Error)
|
|
255
|
+
throw done;
|
|
256
|
+
if (this.#offset < frame.base)
|
|
257
|
+
throw evicted();
|
|
258
|
+
if (this.#offset < frame.written.peek()) {
|
|
259
|
+
const chunk = frame.chunk(this.#offset);
|
|
260
|
+
this.#offset += chunk.byteLength;
|
|
261
|
+
return chunk;
|
|
262
|
+
}
|
|
263
|
+
return done === null ? undefined : WAIT;
|
|
264
|
+
}
|
|
265
|
+
/** The next chunk of the payload, waiting for it to be written; `undefined` once every byte is read. */
|
|
266
|
+
readChunk() {
|
|
267
|
+
return this.#readChunk();
|
|
268
|
+
}
|
|
269
|
+
async #readChunk(closed) {
|
|
270
|
+
for (;;) {
|
|
271
|
+
const chunk = this.#poll();
|
|
272
|
+
if (chunk !== WAIT)
|
|
273
|
+
return chunk;
|
|
274
|
+
const changed = Signal.race(...chunkChanged(this));
|
|
275
|
+
if (closed === undefined)
|
|
276
|
+
await changed;
|
|
277
|
+
// A frame changes with a byte count or a verdict; only the stream resolves void.
|
|
278
|
+
else if ((await race([changed, closed])) === undefined)
|
|
279
|
+
return undefined;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* The rest of the payload in one buffer, copied only when it spans chunks. It grows as
|
|
284
|
+
* bytes arrive, so a declared size is never allocated ahead of them.
|
|
285
|
+
*/
|
|
286
|
+
async readAll() {
|
|
287
|
+
const parts = [];
|
|
288
|
+
let size = 0;
|
|
289
|
+
for (let chunk = await this.readChunk(); chunk; chunk = await this.readChunk()) {
|
|
290
|
+
parts.push(chunk);
|
|
291
|
+
size += chunk.byteLength;
|
|
292
|
+
}
|
|
293
|
+
return parts.length === 0 ? EMPTY : joined(parts, size);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=frame.js.map
|
package/frame.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../src/frame.ts"],"names":[],"mappings":"AAMA,OAAO,EAAe,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiBjD,+FAA+F;AAC/F,kFAAkF;AAClF,4FAA4F;AAC5F,6FAA6F;AAC7F,gBAAgB;AAChB,MAAM,OAAO,OAAO;IACV,IAAI,CAAS;IACb,SAAS,CAAY;IAC9B,OAAO,CAAW;IAClB,2DAA2D;IAClD,OAAO,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IACjC,6FAA6F;IACpF,IAAI,GAAG,IAAI,IAAI,EAAgB,CAAC;IACzC,kDAAkD;IAClD,IAAI,GAAG,CAAC,CAAC;IACT,gDAAgD;IAChD,QAAQ,GAAG,CAAC,CAAC;IACb,SAAS,GAAG,IAAI,KAAK,EAAc,CAAC;IACpC,wFAAwF;IACxF,MAAM,GAAG,KAAK,CAAC;IAEf,YAAY,IAAU;QACrB,IAAI,CAAC,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AU,CAAC,MAAsB;QACtC,SAAS,CAAC;YACT,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAC3B,IAAI,KAAK,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;YACjC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;YACnD,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,OAAO,CAAC;YACxC,iFAAiF;iBAC5E,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;QAC1E,CAAC;IACF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,MAAM,KAAK,GAAiB,EAAE,CAAC;QAC/B,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAChF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClB,IAAI,IAAI,KAAK,CAAC,UAAU,CAAC;QAC1B,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;CACD","sourcesContent":["/**\n * Frame role handles: one frame's payload written or read in pieces as it arrives.\n *\n * @module\n */\nimport type { Instant } from \"@moq/clock\";\nimport { type Getter, Once, race, Signal } from \"@moq/signals\";\nimport { StreamCode, StreamError } from \"./error.ts\";\nimport { stored } from \"./flate/group.ts\";\nimport type { Frame, Producer as GroupProducer } from \"./group.ts\";\nimport { hooks } from \"./internal.ts\";\nimport { Queue } from \"./queue.ts\";\nimport type { Timestamp } from \"./time.ts\";\nimport { SEGMENT_BYTES } from \"./util/limits.ts\";\n\n/**\n * A frame's header, declared before its payload, as Rust's `frame::Info`.\n *\n * @public\n */\nexport interface Info {\n\t/** The payload size in bytes, which the writes must add up to exactly. */\n\tsize: number;\n\t/**\n\t * Presentation timestamp, or on a scale-less track {@link Timestamp.unscaled} at its group's\n\t * key (see `Group.Frame.timestamp`).\n\t */\n\ttimestamp: Timestamp;\n}\n\n// A frame written in pieces, shared by its group and every mirror. Written whole, it stays the\n// writer's one buffer; otherwise it is one buffer within a segment, or a chain of\n// `SEGMENT_BYTES` segments, each allocated by its first byte. Sealed segments shed from the\n// front under the group's tail budget, so a reader that falls behind inside it is `Evicted`.\n/** @internal */\nexport class Chunked implements Frame {\n\treadonly size: number;\n\treadonly timestamp: Timestamp;\n\tcreated?: Instant;\n\t// Bytes written so far, which a streaming reader waits on.\n\treadonly written = new Signal(0);\n\t// Settled once every byte is written (`null`), or with the failure that cut the frame short.\n\treadonly done = new Once<Error | null>();\n\t// The frame offset of the first retained segment.\n\tbase = 0;\n\t// Allocated bytes across the retained segments.\n\tretained = 0;\n\t#segments = new Queue<Uint8Array>();\n\t// Whether one write carried the whole frame, which is then a single buffer of any size.\n\t#whole = false;\n\n\tconstructor(info: Info) {\n\t\tthis.size = info.size;\n\t\tthis.timestamp = info.timestamp;\n\t}\n\n\t// Append `chunk`, returning the bytes newly allocated for it.\n\twrite(chunk: Uint8Array): number {\n\t\tlet at = this.written.peek();\n\t\tif (at === 0 && chunk.byteLength === this.size) {\n\t\t\tthis.#whole = true;\n\t\t\tthis.#segments.push(chunk);\n\t\t\tthis.retained += chunk.byteLength;\n\t\t\tthis.written.set(this.size);\n\t\t\treturn chunk.byteLength;\n\t\t}\n\t\tlet allocated = 0;\n\t\tlet offset = 0;\n\t\twhile (offset < chunk.byteLength) {\n\t\t\t// The open segment ends at the next segment boundary, or the frame's end.\n\t\t\tif (at % SEGMENT_BYTES === 0) {\n\t\t\t\tconst segment = new Uint8Array(Math.min(SEGMENT_BYTES, this.size - at));\n\t\t\t\tthis.#segments.push(segment);\n\t\t\t\tthis.retained += segment.byteLength;\n\t\t\t\tallocated += segment.byteLength;\n\t\t\t}\n\t\t\tconst segment = this.#segments.last as Uint8Array;\n\t\t\tconst start = at % SEGMENT_BYTES;\n\t\t\tconst n = Math.min(chunk.byteLength - offset, segment.byteLength - start);\n\t\t\tsegment.set(chunk.subarray(offset, offset + n), start);\n\t\t\toffset += n;\n\t\t\tat += n;\n\t\t}\n\t\tthis.written.set(at);\n\t\treturn allocated;\n\t}\n\n\t// The written bytes from frame offset `at` to the end of its segment, as a view.\n\tchunk(at: number): Uint8Array {\n\t\tconst written = this.written.peek();\n\t\tif (this.#whole) {\n\t\t\tconst whole = this.#segments.first as Uint8Array;\n\t\t\treturn at === 0 ? whole : whole.subarray(at, written);\n\t\t}\n\t\tconst index = Math.floor(at / SEGMENT_BYTES);\n\t\tconst segment = this.#segments.at(index - this.base / SEGMENT_BYTES) as Uint8Array;\n\t\tconst start = index * SEGMENT_BYTES;\n\t\treturn segment.subarray(at - start, Math.min(segment.byteLength, written - start));\n\t}\n\n\t// Drop the oldest sealed segment, returning its bytes, or 0 when only the newest is left.\n\tshed(): number {\n\t\tif (this.#segments.length <= 1) return 0;\n\t\tconst segment = this.#segments.shift() as Uint8Array;\n\t\tthis.base += segment.byteLength;\n\t\tthis.retained -= segment.byteLength;\n\t\treturn segment.byteLength;\n\t}\n\n\t// Release every segment once the group lets go of the frame.\n\trelease(): void {\n\t\tthis.#segments = new Queue();\n\t\tthis.base = this.size;\n\t\tthis.retained = 0;\n\t}\n\n\tget payload(): Uint8Array {\n\t\tconst done = this.done.peek();\n\t\tif (done instanceof Error) throw done;\n\t\tif (done === undefined) throw new Error(\"frame is still being written\");\n\t\tif (this.base > 0) throw evicted();\n\t\tif (this.#segments.length === 1) return this.chunk(0);\n\t\tconst out = new Uint8Array(this.size);\n\t\tlet offset = 0;\n\t\tfor (const segment of this.#segments) {\n\t\t\tout.set(segment, offset);\n\t\t\toffset += segment.byteLength;\n\t\t}\n\t\treturn out;\n\t}\n}\n\n// The payload size, without joining a chunked frame's segments.\n/** @internal */\nexport function payloadBytes(frame: Frame): number {\n\tif (frame instanceof Chunked) return frame.size;\n\treturn stored(frame)?.payload.length ?? frame.payload.byteLength;\n}\n\n/** @internal */\nexport const EMPTY = new Uint8Array(0);\n\n/** @internal */\nexport function evicted(): Error {\n\treturn new StreamError(StreamCode.Evicted, { message: \"group front was evicted\" });\n}\n\n// What a frame producer drives in its group.\n/** @internal */\nexport interface Ops {\n\twritten(): number;\n\twrite(chunk: Uint8Array): void;\n\tfinish(): GroupProducer;\n\tabort(error: Error): void;\n}\n\n/** @internal */\nexport let makeProducer: (info: Info, ops: Ops) => Producer;\n\n/**\n * Writes one frame's payload in pieces, as Rust's `frame::Producer`. Obtain one from\n * `Group.Producer.createFrame`.\n *\n * The writes must add up to the declared size exactly, and {@link finish} commits the frame.\n * Its group takes no other frame until then; ending the group first fails the frame.\n *\n * @public\n */\nexport class Producer {\n\t/** The declared payload size in bytes. */\n\treadonly size: number;\n\t/** The frame's presentation timestamp, or on a scale-less track its group's key. */\n\treadonly timestamp: Timestamp;\n\t#ops: Ops;\n\t#done = false;\n\n\tprivate constructor(info: Info, ops: Ops) {\n\t\tthis.size = info.size;\n\t\tthis.timestamp = info.timestamp;\n\t\tthis.#ops = ops;\n\t}\n\n\tstatic {\n\t\tmakeProducer = (info, ops) => new Producer(info, ops);\n\t\thooks.abortFrame = (frame, error) => frame.#fail(error);\n\t}\n\n\t/** Bytes still needed to complete the frame. */\n\tget remaining(): number {\n\t\treturn this.size - this.#ops.written();\n\t}\n\n\t/** Append `chunk`, waking readers streaming the frame. The bytes are copied unless one write carries the whole frame. */\n\twrite(chunk: Uint8Array): void {\n\t\tif (this.#done) throw new Error(\"frame is closed\");\n\t\tif (chunk.byteLength > this.remaining) throw new RangeError(\"write exceeds the frame's declared size\");\n\t\tif (chunk.byteLength > 0) this.#ops.write(chunk);\n\t}\n\n\t/** Commit the frame once every declared byte is written, returning its group to write the rest. */\n\tfinish(): GroupProducer {\n\t\tif (this.#done) throw new Error(\"frame is closed\");\n\t\tif (this.remaining !== 0) throw new RangeError(`frame is ${this.remaining} bytes short of its declared size`);\n\t\tthis.#done = true;\n\t\treturn this.#ops.finish();\n\t}\n\n\t/**\n\t * Give the frame and its group up for now, as {@link GroupProducer.abort} does. A no-op once the\n\t * frame finished or aborted. Mirrors the Rust `frame::Producer::abort`.\n\t */\n\t// fallow-ignore-next-line unused-class-member\n\tabort(): void {\n\t\tthis.#fail(new StreamError(StreamCode.Cancel, { message: \"frame aborted\" }));\n\t}\n\n\t#fail(error: Error): void {\n\t\tif (this.#done) return;\n\t\tthis.#done = true;\n\t\tthis.#ops.abort(error);\n\t}\n}\n\n/** @internal */\nexport let makeConsumer: (index: number, frame: Frame) => Consumer;\n// The next chunk without waiting: `undefined` at the end, or `WAIT` until the next write.\n/** @internal */\nexport let pollChunk: (consumer: Consumer) => Uint8Array | undefined | typeof WAIT;\n// What a waiting chunk read waits on.\n/** @internal */\nexport let chunkChanged: (consumer: Consumer) => Getter<unknown>[];\n/** @internal */\nexport const WAIT: unique symbol = Symbol(\"wait\");\n\n// Parts read in order, joined into one buffer, copied only when there is more than one.\n/** @internal */\nexport function joined(parts: Uint8Array[], size: number): Uint8Array {\n\tif (parts.length === 1) return parts[0];\n\tconst out = new Uint8Array(size);\n\tlet at = 0;\n\tfor (const part of parts) {\n\t\tout.set(part, at);\n\t\tat += part.byteLength;\n\t}\n\treturn out;\n}\n\n/**\n * Reads one frame's payload as it arrives, as Rust's `frame::Consumer`. Obtain one from\n * `Group.Consumer.nextFrame`.\n *\n * Chunks are read-only views shared with other readers. A frame larger than its group's\n * retained tail sheds its oldest segments while it is written, so a reader that falls that\n * far behind fails with a `StreamError` of code `Evicted`.\n *\n * @public\n */\nexport class Consumer {\n\t/** The frame's index within its group, counting from 0 in write order. */\n\treadonly index: number;\n\t/** The payload size in bytes. */\n\treadonly size: number;\n\t/** The frame's presentation timestamp, or on a scale-less track its group's key. */\n\treadonly timestamp: Timestamp;\n\t#frame: Frame;\n\t#offset = 0;\n\n\tprivate constructor(index: number, frame: Frame) {\n\t\tthis.index = index;\n\t\tthis.#frame = frame;\n\t\tthis.size = payloadBytes(frame);\n\t\tthis.timestamp = frame.timestamp;\n\t}\n\n\tstatic {\n\t\tmakeConsumer = (index, frame) => new Consumer(index, frame);\n\t\thooks.readFrameChunk = (consumer, closed) => consumer.#readChunk(closed);\n\t\tpollChunk = (consumer) => consumer.#poll();\n\t\tchunkChanged = (consumer) => {\n\t\t\tconst frame = consumer.#frame;\n\t\t\treturn frame instanceof Chunked ? [frame.written, frame.done] : [];\n\t\t};\n\t}\n\n\t/** When the frame's last byte landed in this node's group; `undefined` until then. */\n\tget created(): Instant | undefined {\n\t\treturn this.#frame.created;\n\t}\n\n\t#poll(): Uint8Array | undefined | typeof WAIT {\n\t\tconst frame = this.#frame;\n\t\tif (!(frame instanceof Chunked)) {\n\t\t\tif (this.#offset >= this.size) return undefined;\n\t\t\tthis.#offset = this.size;\n\t\t\treturn frame.payload;\n\t\t}\n\t\tconst done = frame.done.peek();\n\t\tif (done instanceof Error) throw done;\n\t\tif (this.#offset < frame.base) throw evicted();\n\t\tif (this.#offset < frame.written.peek()) {\n\t\t\tconst chunk = frame.chunk(this.#offset);\n\t\t\tthis.#offset += chunk.byteLength;\n\t\t\treturn chunk;\n\t\t}\n\t\treturn done === null ? undefined : WAIT;\n\t}\n\n\t/** The next chunk of the payload, waiting for it to be written; `undefined` once every byte is read. */\n\treadChunk(): Promise<Uint8Array | undefined> {\n\t\treturn this.#readChunk();\n\t}\n\n\tasync #readChunk(closed?: Promise<void>): Promise<Uint8Array | undefined> {\n\t\tfor (;;) {\n\t\t\tconst chunk = this.#poll();\n\t\t\tif (chunk !== WAIT) return chunk;\n\t\t\tconst changed = Signal.race(...chunkChanged(this));\n\t\t\tif (closed === undefined) await changed;\n\t\t\t// A frame changes with a byte count or a verdict; only the stream resolves void.\n\t\t\telse if ((await race([changed, closed])) === undefined) return undefined;\n\t\t}\n\t}\n\n\t/**\n\t * The rest of the payload in one buffer, copied only when it spans chunks. It grows as\n\t * bytes arrive, so a declared size is never allocated ahead of them.\n\t */\n\tasync readAll(): Promise<Uint8Array> {\n\t\tconst parts: Uint8Array[] = [];\n\t\tlet size = 0;\n\t\tfor (let chunk = await this.readChunk(); chunk; chunk = await this.readChunk()) {\n\t\t\tparts.push(chunk);\n\t\t\tsize += chunk.byteLength;\n\t\t}\n\t\treturn parts.length === 0 ? EMPTY : joined(parts, size);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as Group from "./group.ts";
|
|
2
|
+
import type * as Track from "./track.ts";
|
|
3
|
+
/** Append a group to the scale-less `track` and write `payload` as its first frame, leaving it open. */
|
|
4
|
+
export declare function appendFrame(track: Track.Producer, payload: Uint8Array): Group.Producer;
|
|
5
|
+
//# sourceMappingURL=frame.test-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.test-util.d.ts","sourceRoot":"","sources":["../src/frame.test-util.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAGzC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAItF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { hooks } from "./internal.js";
|
|
2
|
+
import { Timestamp } from "./time.js";
|
|
3
|
+
/** Append a group to the scale-less `track` and write `payload` as its first frame, leaving it open. */
|
|
4
|
+
export function appendFrame(track, payload) {
|
|
5
|
+
const group = hooks.appendNext(track);
|
|
6
|
+
group.writeFrame({ payload, timestamp: Timestamp.unscaled(group.start) });
|
|
7
|
+
return group;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=frame.test-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.test-util.js","sourceRoot":"","sources":["../src/frame.test-util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,wGAAwG;AACxG,MAAM,UAAU,WAAW,CAAC,KAAqB,EAAE,OAAmB;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC1E,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["// Scale-less frames for tests: a scale-less track has no time, so each frame's timestamp is its\n// group's key.\nimport type * as Group from \"./group.ts\";\nimport { hooks } from \"./internal.ts\";\nimport { Timestamp } from \"./time.ts\";\nimport type * as Track from \"./track.ts\";\n\n/** Append a group to the scale-less `track` and write `payload` as its first frame, leaving it open. */\nexport function appendFrame(track: Track.Producer, payload: Uint8Array): Group.Producer {\n\tconst group = hooks.appendNext(track);\n\tgroup.writeFrame({ payload, timestamp: Timestamp.unscaled(group.start) });\n\treturn group;\n}\n"]}
|
package/group.d.ts
CHANGED
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
import { type Instant } from "@moq/clock";
|
|
6
7
|
import { type GetPromise } from "@moq/signals";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export declare const MAX_GROUP_CACHE_BYTES: number;
|
|
10
|
-
/** Maximum number of frames in a group. 8192 is the largest legal group; the 8193rd write is {@link GroupTooLarge}. */
|
|
11
|
-
export declare const MAX_GROUP_FRAMES = 8192;
|
|
8
|
+
import { type Consumer as FrameConsumer, type Info as FrameInfo, type Producer as FrameProducer } from "./frame.ts";
|
|
9
|
+
import { type Timestamp } from "./time.ts";
|
|
12
10
|
/**
|
|
13
11
|
* A frame buffered in a group: its presentation {@link Timestamp} and payload bytes.
|
|
14
12
|
*
|
|
@@ -16,18 +14,28 @@ export declare const MAX_GROUP_FRAMES = 8192;
|
|
|
16
14
|
* converts it into the track's negotiated timescale.
|
|
17
15
|
*/
|
|
18
16
|
export interface Frame {
|
|
19
|
-
/** The
|
|
17
|
+
/** The plain payload, shared across readers even when the track stores compressed bytes. */
|
|
20
18
|
payload: Uint8Array;
|
|
21
19
|
/**
|
|
22
|
-
* Presentation timestamp.
|
|
23
|
-
*
|
|
20
|
+
* Presentation timestamp at the track's timescale. A scale-less track has no time, so its
|
|
21
|
+
* frame carries {@link Timestamp.unscaled} at its group's key instead. A write that
|
|
22
|
+
* disagrees with its track, or names another group's key, is refused with
|
|
23
|
+
* {@link TimestampMismatch}.
|
|
24
24
|
*/
|
|
25
25
|
timestamp: Timestamp;
|
|
26
|
+
/**
|
|
27
|
+
* When the frame landed in this node's group, on the installed clock.
|
|
28
|
+
*
|
|
29
|
+
* Every frame a group returns carries the instant it was written, received, or fetched
|
|
30
|
+
* into it, so a reader judges lateness on that rather than on when it got around to
|
|
31
|
+
* reading. A write ignores it and stamps its own.
|
|
32
|
+
*/
|
|
33
|
+
created?: Instant;
|
|
26
34
|
}
|
|
27
|
-
/** Options for
|
|
35
|
+
/** Options for an index-aware frame read. */
|
|
28
36
|
export interface ReadOptions {
|
|
29
37
|
/**
|
|
30
|
-
* The lowest
|
|
38
|
+
* The lowest frame index the caller wants; defaults to the whole group.
|
|
31
39
|
*
|
|
32
40
|
* Frames below it are discarded instead of returned. The group still starts at frame 0,
|
|
33
41
|
* so this is a reader filter, not a missing prefix.
|
|
@@ -36,8 +44,23 @@ export interface ReadOptions {
|
|
|
36
44
|
}
|
|
37
45
|
/** Immutable group metadata. */
|
|
38
46
|
export interface Info {
|
|
39
|
-
/**
|
|
40
|
-
|
|
47
|
+
/** Where this group starts, in its track's timescale: its key on the track. */
|
|
48
|
+
start: bigint;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A group its producer finished: every frame is written, and it can still be read, but not
|
|
52
|
+
* written to. {@link Producer.finish} returns it, mirroring the Rust `group::Finished`; the
|
|
53
|
+
* producer itself still refuses a write after the finish.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export interface Finished {
|
|
58
|
+
/** Where this group starts, in its track's timescale: its key on the track. */
|
|
59
|
+
readonly start: bigint;
|
|
60
|
+
/** Settles once the group closes: `null` on a clean close, or the abort {@link Error}. */
|
|
61
|
+
readonly closed: GetPromise<Error | null>;
|
|
62
|
+
/** A read handle for this group. */
|
|
63
|
+
consume(): Consumer;
|
|
41
64
|
}
|
|
42
65
|
/**
|
|
43
66
|
* The write side of an ordered stream of frames within a track.
|
|
@@ -46,9 +69,9 @@ export interface Info {
|
|
|
46
69
|
*/
|
|
47
70
|
export declare class Producer {
|
|
48
71
|
#private;
|
|
49
|
-
/**
|
|
50
|
-
readonly
|
|
51
|
-
constructor(
|
|
72
|
+
/** Where this group starts, in its track's timescale: its key on the track. */
|
|
73
|
+
readonly start: bigint;
|
|
74
|
+
constructor(start: bigint);
|
|
52
75
|
/**
|
|
53
76
|
* Settles once the group closes: `null` on a clean close, or the abort {@link Error}.
|
|
54
77
|
* Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
|
|
@@ -58,16 +81,42 @@ export declare class Producer {
|
|
|
58
81
|
consume(): Consumer;
|
|
59
82
|
/** Writes a frame to the group. */
|
|
60
83
|
writeFrame(frame: Frame): void;
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Start a frame of `info.size` bytes, written in pieces, as Rust's `create_frame`.
|
|
86
|
+
*
|
|
87
|
+
* Readers can stream it as it is written (see {@link Consumer.nextFrame}), so a frame
|
|
88
|
+
* of any size is held only within the group's retained tail. No other frame can be
|
|
89
|
+
* written until this one finishes.
|
|
90
|
+
*/
|
|
91
|
+
createFrame(info: FrameInfo): FrameProducer;
|
|
92
|
+
/**
|
|
93
|
+
* Ends the group without saying where it ends, returning it as {@link Finished}: every frame
|
|
94
|
+
* written reaches its readers, but they can't tell the group is whole. Idempotent, as the
|
|
95
|
+
* Rust `group::Producer::finish`.
|
|
96
|
+
*/
|
|
97
|
+
finish(): Finished;
|
|
98
|
+
/**
|
|
99
|
+
* Ends the group whole at `end`, the exclusive end of its presentation in the track's
|
|
100
|
+
* timescale, returning it as {@link Finished}, as the Rust `group::Producer::finish_at`. An
|
|
101
|
+
* `end` below the group's start, or below its highest frame timestamp, throws
|
|
102
|
+
* {@link TimestampMismatch}; one equal to either is accepted.
|
|
103
|
+
*/
|
|
104
|
+
finishAt(end: bigint): Finished;
|
|
105
|
+
/**
|
|
106
|
+
* Gives the group up for now, as dropping a Rust `group::Producer` unfinished does: readers that
|
|
107
|
+
* have not drained it end with `StreamCode.Cancel`, and the track lets it go as it would an
|
|
108
|
+
* evicted group, so a reader that still wants it asks a fill for it again, though an end declared
|
|
109
|
+
* above it settles clean only once the group is created again whole, skipped, or dropped. A no-op
|
|
110
|
+
* once the group finished, aborted, or skipped. Mirrors the Rust `group::Producer::abort`.
|
|
111
|
+
*/
|
|
112
|
+
abort(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Declares that the group will never exist: readers that have not drained it end with
|
|
115
|
+
* `StreamCode.Skip`, and its track records the key skipped for good, refusing to create it again,
|
|
116
|
+
* which a relay forwards. A no-op once the group finished, aborted, or skipped. Mirrors the Rust
|
|
117
|
+
* `group::Producer::skip`.
|
|
118
|
+
*/
|
|
119
|
+
skip(): void;
|
|
71
120
|
}
|
|
72
121
|
/**
|
|
73
122
|
* The read side of an ordered stream of frames within a track.
|
|
@@ -79,23 +128,35 @@ export declare class Producer {
|
|
|
79
128
|
*/
|
|
80
129
|
export declare class Consumer {
|
|
81
130
|
#private;
|
|
82
|
-
/**
|
|
83
|
-
readonly
|
|
131
|
+
/** Where this group starts, in its track's timescale: its key on the track. */
|
|
132
|
+
readonly start: bigint;
|
|
84
133
|
private constructor();
|
|
134
|
+
/**
|
|
135
|
+
* When the group joined its track at this hop, before its first frame, on the installed
|
|
136
|
+
* clock: its header was received, or it was fetched or created here.
|
|
137
|
+
*
|
|
138
|
+
* A reader that gets to the group late still measures from when it landed, as
|
|
139
|
+
* {@link Frame.created} does for each frame. A consumer resumed onto a replacement copy
|
|
140
|
+
* keeps the original group's arrival.
|
|
141
|
+
*/
|
|
142
|
+
get created(): Instant;
|
|
143
|
+
/**
|
|
144
|
+
* Where the group ends in its track's timescale, once its producer finished it whole with
|
|
145
|
+
* {@link Producer.finishAt}'s `end`: undefined while it is open, or when it ended without one.
|
|
146
|
+
*/
|
|
147
|
+
get end(): bigint | undefined;
|
|
85
148
|
/**
|
|
86
149
|
* Settles when this consumer reaches a terminal state: `null` after a clean close has no
|
|
87
150
|
* unread or in-flight frames, or the terminal {@link Error}.
|
|
88
151
|
* Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
|
|
89
152
|
*/
|
|
90
153
|
get closed(): GetPromise<Error | null>;
|
|
91
|
-
/** True once no further frames can be read: the group has closed and every buffered frame is read. */
|
|
154
|
+
/** True once no further frames can be read: this handle or the group has closed, and every buffered frame is read. */
|
|
92
155
|
get done(): boolean;
|
|
93
|
-
/** True once the group has been closed, regardless of whether buffered frames remain unread. Synchronous complement to the {@link closed} promise. */
|
|
94
|
-
get isClosed(): boolean;
|
|
95
156
|
/**
|
|
96
157
|
* How many frames the group has held, including any already read.
|
|
97
158
|
*
|
|
98
|
-
* It is also the next frame's
|
|
159
|
+
* It is also the next frame's index, so `frameCount - 1` names the newest
|
|
99
160
|
* frame written so far. A publisher snapshots it to resolve the track's live edge.
|
|
100
161
|
*/
|
|
101
162
|
get frameCount(): number;
|
|
@@ -107,9 +168,9 @@ export declare class Consumer {
|
|
|
107
168
|
* end-of-group: check {@link done} to tell "no frame buffered yet" from "finished".
|
|
108
169
|
*/
|
|
109
170
|
tryReadFrame(): Frame | undefined;
|
|
110
|
-
/** Like {@link tryReadFrame} but also reports the frame's
|
|
111
|
-
|
|
112
|
-
|
|
171
|
+
/** Like {@link tryReadFrame} but also reports the frame's index within the group. */
|
|
172
|
+
tryReadFrameIndex(): ({
|
|
173
|
+
index: number;
|
|
113
174
|
} & Frame) | undefined;
|
|
114
175
|
/** Resolves once {@link readFrame} would not block. */
|
|
115
176
|
readable(): Promise<void>;
|
|
@@ -119,19 +180,21 @@ export declare class Consumer {
|
|
|
119
180
|
*/
|
|
120
181
|
readFrame(): Promise<Frame | undefined>;
|
|
121
182
|
/**
|
|
122
|
-
* Reads the next frame along with its
|
|
183
|
+
* Reads the next frame along with its index within the group.
|
|
123
184
|
* Treat the returned frame bytes as read-only; they are shared with other consumers.
|
|
124
185
|
*/
|
|
125
|
-
|
|
126
|
-
|
|
186
|
+
readFrameIndex(options?: ReadOptions): Promise<({
|
|
187
|
+
index: number;
|
|
127
188
|
} & Frame) | undefined>;
|
|
128
|
-
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
189
|
+
/**
|
|
190
|
+
* Reads the next frame as it arrives, as Rust's `next_frame`: resolves once its header is
|
|
191
|
+
* buffered, without waiting for its payload. Use it for a frame too large to hold whole.
|
|
192
|
+
*/
|
|
193
|
+
nextFrame(): Promise<FrameConsumer | undefined>;
|
|
194
|
+
/**
|
|
195
|
+
* Release this handle, like dropping a Rust consumer. Never changes the group for other
|
|
196
|
+
* readers or the producer. It drains what it buffered and then ends. Idempotent.
|
|
197
|
+
*/
|
|
198
|
+
close(): void;
|
|
136
199
|
}
|
|
137
200
|
//# sourceMappingURL=group.d.ts.map
|
package/group.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,OAAO,EAAO,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAyB,KAAK,UAAU,EAAmC,MAAM,cAAc,CAAC;AAIvG,OAAO,EAKN,KAAK,QAAQ,IAAI,aAAa,EAC9B,KAAK,IAAI,IAAI,SAAS,EACtB,KAAK,QAAQ,IAAI,aAAa,EAO9B,MAAM,YAAY,CAAC;AAYpB,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAgBpE;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACrB,4FAA4F;IAC5F,OAAO,EAAE,UAAU,CAAC;IACpB;;;;;OAKG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAOD,6CAA6C;AAC7C,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,gCAAgC;AAChC,MAAM,WAAW,IAAI;IACpB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;CACd;AA+OD;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC1C,oCAAoC;IACpC,OAAO,IAAI,QAAQ,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,QAAQ;;IACpB,+EAA+E;IAC/E,QAAQ,CAA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