Skip to content

Commit 9fd2fcc

Browse files
authored
Merge pull request #54 from madebylotus/feature/update-readme-with-info-on-sidekiq
Adds mention of using RequestStore with Sidekiq
2 parents 2b5e071 + 9ba87b8 commit 9fd2fcc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ our controller:
2727
def index
2828
Thread.current[:counter] ||= 0
2929
Thread.current[:counter] += 1
30-
30+
3131
render :text => Thread.current[:counter]
3232
end
3333
```
@@ -97,6 +97,11 @@ def app
9797
end
9898
```
9999

100+
## Using with Sidekiq
101+
This gem uses a Rack middleware to clear the store object after every request, but that doesn't translate well to background processing with [Sidekiq](https://github.com/mperham/sidekiq).
102+
103+
A companion library, [request_store-sidekiq](https://rubygems.org/gems/request_store-sidekiq) creates a Sidekiq middleware that will ensure the store is cleared after each job is processed, for security and consistency with how this is done in Rack.
104+
100105
## Semantic Versioning
101106

102107
This project conforms to [semver](http://semver.org/). As a result of this

0 commit comments

Comments
 (0)