Comments (5)
In CBV have access to the object "sse" with "self.sse" attribute.
If you think there improve this part, talk and see if they improve.
Andrey
from django-sse.
I'm new to SSE, but it seems like I should be able to optionally set the id
on every message. How would you feel about changing the signature of Sse.add_message
to be def add_message(self, event, text, id=None, encoding='utf-8')
. I could work around it, but maybe it is better to set it upstream?
I'm happy to do the work, I'd just like to get your thoughts first.
from django-sse.
Currently it has the method sse.set_event_id("some-id")
, which is used to specify the id, and then sse.reset_event_id()
to reset the id.
Within the block with ID can send multiple events. I believe that the implementation matches the specification.
You can look here: http://www.w3.org/TR/eventsource/#concept-event-stream-last-event-id
from django-sse.
ok, I should be able to handle the way I'd like (new ID with every message) with a small wrapper function. Having access to self.sse
will give me everything I need. Thanks!
from django-sse.
;) If you have any questions or think I can help you. You can ask without any problem. ;)
from django-sse.
Related Issues (15)
- Long polling / streaming updates HOT 5
- Allow for CORS parameters HOT 2
- Max Connections HOT 2
- USE_ETAGS in settings.py breaks sse HOT 1
- Allow using django database as message queue HOT 2
- Is there a way to support heartbeat responses? HOT 1
- redisqueue error HOT 1
- is not possible to redirect the project? HOT 1
- redis memory usage HOT 1
- Difference between pip and git code
- Server is dying on more than 8 concurrent connections
- server_addr not set
- Runserver doesn't reload with an active SSE connection HOT 1
- cleanup connections HOT 10
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-sse.