Comments (4)
Hi there. If you want to store events in redis instead of a SQL database, you could write your own StorageBase
implementation and then set settings.EVENTSTREAM_STORAGE_CLASS
. However, the problem with multiple processes isn't storage, it's distribution. The approach used by django-eventstream when there are multiple processes is to rely on Pushpin for distribution. See https://github.com/fanout/django-eventstream#multiple-instances-and-scaling
from django-eventstream.
fine! thanks!
from django-eventstream.
Hi ! I'm bumping this. So in multi processes situation, I want to use redis as Storage backend i would lets Pushpin rely on Redis instead of Django right ?
Like the documentation of Pushpin says with a Kafka exemple here: https://github.com/fanout/kafka-sse-example
from django-eventstream.
In django-evenstream, storage is separate from distribution, and only storage is pluggable. You can subclass StorageBase
to store messages in Redis, but distribution will continue to go directly from Django to Pushpin. This will work with multiple processes.
The Pushpin Kafka example is built differently, using a background process that reads from Kafka. It may be possible to hack django-eventstream to work similarly, by changing send_event
to not send to Pushpin and then making a background process that listens to Redis for changes and reuses django-eventstream utility functions for publishing to Pushpin. But this would be tricky and I'm not sure why you'd want to do this.
One nice thing about django-eventstream compared to the Kafka example is that it doesn't have any background processes, so it can be run statelessly.
from django-eventstream.
Related Issues (20)
- Do I need close channels when all data are sent? HOT 2
- Why there is a hardcoded channel name prefix `events-` in case of pushpin proxy HOT 3
- send_event not sending an event in localhost HOT 4
- Support ZeroMQ HOT 1
- What is the difference between evenstream and websockets? HOT 2
- Does not work for utf-8 symbols HOT 1
- Headers are missing in django-eventstream url patterns HOT 1
- Support for django-rq HOT 1
- ModuleNotFoundError: No module named 'channels.http' HOT 3
- CORS Error: How can we allow multiple origins HOT 2
- Compatibility with htmx HOT 5
- How to run examples using Uvicorn? HOT 4
- AttributeError: 'ASGIRequest' object has no attribute 'grip' HOT 1
- Django rest framework router register eventstream HOT 2
- Further pull request for REST version
- Change path of static file
- Question: Why Django 5+? HOT 1
- Improve logging HOT 1
- Filtering events before sending to a client HOT 7
- Interested in tests dev ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-eventstream.