Reusing the same service object in multithread server okay?
Opened this issue · 0 comments
EllaBellaStella commented
I could not find any mention of thread safety in general within the documentation. Specifically in my use case is it okay to do something like:
# application setup
BLOB_SERVICE = Azure::Storage::Blob::BlobService.create(...)
QUEUE_SERVICE = Azure::Storage::Queue::QueueService.create(...)
...
# multiple threads calling these as part our Puma server responding to requests
blob, contents = BLOB_SERVICE.get_blob(...)
BLOB_SERVICE.create_block_blob(...)
QUEUE_SERVICE.create_message(...)
Or should I be creating a new BlobService
, QueueService
, etc. object every time?