How to make EventSink thread safe

Hello,

What is your recommended way of using event sinks with multiple threads?

I subscribe to the event sink when the user logs into the service. There’s a background thread that needs to continually send data to the client. The service also needs to send events when a button is clicked, etc.

Thank you!

Hi,

You can look an example of evenk sink in SuperHTTP chat, like

  ev := EventRepository as IChatEvents_Writer;
  ev.ExcludeSender := false;
  ev.UserLogin(Session.SessionID, Nickname);

I’ll have a look. Thanks!