You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quoting the current behavior from the documentation:
Note that currently it is not possible to have multiple connections to the main stream from the same client. If you try to do so, the Future returned by this method will not complete.
This is an inconvenient and confusing behavior for a library. It is expected that the implementation will make the connection the first time and reuse it for the second and subsequent connections.
Unresolved questions
Where to implement:
misskey-websocket: Almost looks good, but feel like the obligation (to duplicate the connection) is misplaced
misskey-util: We may need to stop using the extension trait, which is undesirable
The text was updated successfully, but these errors were encountered:
After much consideration, I take an approach that follows FusedIterator on std. The current (and future) StreamingClient has no guarantee on its behavior with multiple attempt to connect to channels; it is just required to send the request and wait for the connection to be established. So, rather than having stronger requirement on StreamingClient, I implement a new trait (named like SharedConnectionStreamingClient) in misskey-util that require implementers to reuse the connection, thus the multiple attempt of connection on "shouldShare" channels must work properly on it. An additional method (named like share_channels) can be implemented on StreamingClientExt to obtain SharedConnectionStreamingClient from StreamingClient (like fuse method on IteratorExt).
You can't have more than two connections to the "shouldShare" channel.
https://github.com/syuilo/misskey/blob/572e475b394aab0fd752783da8648b4f096653fd/src/server/api/stream/index.ts#L220-L222
Quoting the current behavior from the documentation:
This is an inconvenient and confusing behavior for a library. It is expected that the implementation will make the connection the first time and reuse it for the second and subsequent connections.
Unresolved questions
misskey-websocket
: Almost looks good, but feel like the obligation (to duplicate the connection) is misplacedmisskey-util
: We may need to stop using the extension trait, which is undesirableThe text was updated successfully, but these errors were encountered: