fanout / django-eventstream

Server-Sent Events for Django
MIT License
650 stars 85 forks source link

sending events from outside the ASGI request context #21

Closed h1nk closed 5 years ago

h1nk commented 5 years ago

Is it possible to be able to use the send_event function from outside the ASGI execution context, i.e. from a manage command or something?

jkarneges commented 5 years ago

Hi, this can be done if connection handling is delegated to Fanout/Pushpin. Then, send_event can be called from other processes, including management commands or the shell.

See https://github.com/fanout/django-eventstream#multiple-instances-and-scaling