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
As the provider of an event stream, I would like the connection to be automatically be kept alive so that I do not have to manually send dummy messages or comments once in a while.
Example
If enabled, the handler would spawn an additional thread that frequently sends a comment or ping event to the connected client to prevent the connection from being terminated by a proxy and to check whether the client is still connected. If sending the comment fails, the handler should cancel the generator logic using a CancellationToken. Both threads would need to be carefully be synchronized to prevent them from writing to the connection at the same time.
The problem fits to the producer/consumer pattern (some process writing to the connection is consumer and Ping / user logic are producers of events). In C# you can largely utilize BlockingCollection<>. If you want a bit more syntactic sugar around BlockingCollection, you can use 3rd party AsyncCollection.
As the provider of an event stream, I would like the connection to be automatically be kept alive so that I do not have to manually send dummy messages or comments once in a while.
Example
If enabled, the handler would spawn an additional thread that frequently sends a comment or ping event to the connected client to prevent the connection from being terminated by a proxy and to check whether the client is still connected. If sending the comment fails, the handler should cancel the generator logic using a
CancellationToken
. Both threads would need to be carefully be synchronized to prevent them from writing to the connection at the same time.Acceptance criteria
The text was updated successfully, but these errors were encountered: