Git Product home page Git Product logo

Comments (4)

jkarneges avatar jkarneges commented on July 17, 2024

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.

xgkk avatar xgkk commented on July 17, 2024

fine! thanks!

from django-eventstream.

acuD1 avatar acuD1 commented on July 17, 2024

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.

jkarneges avatar jkarneges commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.