Created
November 25, 2018 03:06
-
-
Save tomgrek/ae387e5efb996ba13123c31d72037385 to your computer and use it in GitHub Desktop.
A Very simple MLQ worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from mlq.queue import MLQ | |
mlq = MLQ('example', 'localhost', 6379, 0) | |
def some_listener_func(params, *args): | |
return params | |
def main(): | |
print("Worker starting") | |
async def start_worker(): | |
mlq.create_listener(some_listener_func) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(start_worker()) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment