Actually, the 'Streamer' it self is builded using two 0mq socket.
refer to url i provided, one called 'frontend' and the other called 'backend'
Streamer receive msg via 'frontend' , and push it out via 'backend'
Between that two 0mq socket .. there is in-memory cache, and that is I want it to be on-disk (persistent).
Ahh ... I got it .
I Read https://github.com/dsiroky/snakemq/blob/master/examples/persistent_messaging_connector.py
And I think if I use this persistent connector ... every time I send a message it'll stored on it's sqlite db storage.
My dumb brain still have question :
The persistent connector example just have one shot send. How to send data while this connector in it's 'loop()'
i.e : How if I want a script keep sending --> datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
Once per second ?
Yes. But be aware that snakeMQ does not yet provide a reliable multicast (something like a pub-sub pattern). The persistence is achieved only per individual peer identifiers. In your case if the recipients group is fixed and you know all their identifiers then there is no problem.
Bonus tip/note: the persistence is not bound to the connector or listener, only to a identifier. You can create a snakeMQ stack without any listeners or connectors and send a message with long TTL. It will be stored in the database. The next day you fix your program by adding e.g. a listener and if the appropriate peer connects it will get the message from yesterday.
My dumb brain still have question :
The persistent connector example just have one shot send. How to send data while this connector in it's 'loop()'
i.e : How if I want a script keep sending --> datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
Once per second ?
messaging.send_message() method is thread safe. You can have a dedicated thread that will send those timestamps.
That is terribly slow. Can you send me these testing scripts?
David
That is terribly slow. Can you send me these testing scripts?
David