Azure / Azure/azure-storage-ruby

Reusing the same service object in multithread server okay?

Open
#192 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Ruby
Stars
88
Forks
177
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.