vitorluis / python-mercure Goto Github PK
View Code? Open in Web Editor NEWPython library to publish messages to Mercure Hub!
Home Page: https://pypi.org/project/pymercure/
License: BSD 2-Clause "Simplified" License
Python library to publish messages to Mercure Hub!
Home Page: https://pypi.org/project/pymercure/
License: BSD 2-Clause "Simplified" License
Just spent the last day trying to figure out why the Consumer thread dies out after roughly ~60s of runtime, ๐
this is the way it works and it needs to do a reconnect to the endpoint, involving a Last-Event-ID
.
Some details here: https://mercure.rocks/spec#reconciliation
The Consumer thread uses an older library, sseclient-py,
which does no reconciliation, so you have to handle reconciliation yourself.
There is a newer sseclient library that does reconciliation automatically,
attaching last-event-id, restarting the connection when it ends.
sseclient 0.0.27
https://github.com/btubbs/sseclient
Basically the same that used in dunglas subscribe example:
https://github.com/dunglas/mercure/blob/v0.10.4/examples/subscribe/python.py
Is there a reason to keep using sseclient-py specifically at this moment?
I've made a fork to make a version with btubbs/sseclient.
Leaving this out here in case anybody else gets swamped.
Thanks!
I could not find a way to pass my JWT token to the consumer.
Is it correct that this is not yet possible with this library, or did I miss something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.