MeVitae / redis-work-queue

A cross-platform work queue, on top of a redis database, with implementations in Python, Rust, Go, Node.js (TypeScript) and Dotnet (C#).
MIT License
17 stars 3 forks source link

Is this thread safe ? #10

Closed akhushnazarov closed 1 week ago

akhushnazarov commented 5 months ago

can i run workers in multiple threads ?

JOT85 commented 5 months ago

Yep! You'll see, in each API, the methods take a redis client as an argument.

If each thread has it's own redis client, you can pass the different redis clients as arguments.

Many of the redis clients are also thread safe, meaning you can share a client between threads.

Which language(s) are you using?

akhushnazarov commented 5 months ago

Sorry forgot to mention the language. I am using python.

JOT85 commented 1 week ago

Yes, the methods on the WorkQueue class itself don't mutate the state of the class, and, according to redis-py > Advanced Features, the redis client is also thread safe.