While working on the LP2PQuicTransport interface in #28 I noticed that the WebTransport spec doesn't define a single EventHandler, instead a ReadableStream is used in many cases. As an expertise, here is a comparison based on the LP2PQuicTransportEvent event:
I opened this issue to discuss what kind of design we prefer and/or if mixed use seems appropriate. E.g.: combining onconnection with incomingTransports to match the precedent in their respective API, see #29.
While working on the
LP2PQuicTransport
interface in #28 I noticed that the WebTransport spec doesn't define a singleEventHandler
, instead aReadableStream
is used in many cases. As an expertise, here is a comparison based on theLP2PQuicTransportEvent
event:EventHandler (As currently defined)
Usage:
ReadableStream (hypothetical)
Usage:
Note that this example assumes a LP2PReceiver is started on creation. The usage example assumes support for Async iterable using for await ... of in the absence of which the code becomes slightly more involved.
I opened this issue to discuss what kind of design we prefer and/or if mixed use seems appropriate. E.g.: combining
onconnection
withincomingTransports
to match the precedent in their respective API, see #29.