Using SocketIO with TaskIQ tasks #238
                  
                    
                      kevinhikaruevans
                    
                  
                
                  started this conversation in
                Show and tell
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I have a FastAPI application and I'm slowly integrating TaskIQ with it. It's pretty simple but I thought I'd share how I'm using SocketIO with TaskIQ, in case any one else has a similar use-case.
I'm using SocketIO's namespace classes with fastapi_socketio (a simple wrapper for sio). In my FastAPI app, I'm using AsyncRedisManager:
And in my TaskIQ tasks, I'm doing something similar:
Then, from my async tasks, I'm able to call:
Basically, we're using Redis to pubsub messages between the TaskIQ worker and the FastAPI process.
Beta Was this translation helpful? Give feedback.
All reactions