Skip to content

posting a message to server from external process #885

Answered by streamnsight
streamnsight asked this question in Q&A
Discussion options

You must be logged in to vote

@miguelgrinberg
Thanks for the quick reply, and thanks for the tip on using JSON.
I thought things had to be pickled because that's what the redis-manager does, but indeed after reviewing the listen code, I see it tries multiple methods, including json.loads.

I ended up with:

            const payload = {
                'method': 'emit', 
                'event': 'logs', 
                'data': {'type': 'fetching', 'state': 'failed'} , 
                'namespace': '/', 
                'room': null, 
                'skip_sid': null, 
                'callback': null
            };
            await redisClient.PUBLISH('flask-socketio', JSON.stringify(payload));

and that worked!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by streamnsight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants