-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from zvkemp/better_threadsafety
better threadsafety
- Loading branch information
Showing
5 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
### 0.1.1 | ||
|
||
Provide better threadsafety. This now works correctly: | ||
|
||
```ruby | ||
require 'phoenix/socket' | ||
ps = Phoenix::Socket.new('stat:default') | ||
(1..100).map do |x| | ||
Thread.new do | ||
ps.request_reply(event: 'word_count', payload: { user_id: x }) | ||
end | ||
end.map(&:value) | ||
``` | ||
|
||
- EventMachine thread spawning is now limited to a single concurrent instance | ||
- Requests wait until the channel has received join confirmation (no more 'Unknown Topic' errors) | ||
- Certain conditions are now broadcasts instead of signals (prevent threads from sleeping forever when their replies come out-of-order) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module Rb | ||
module Phoenix | ||
module Socket | ||
VERSION = "0.1.0" | ||
VERSION = "0.1.1" | ||
end | ||
end | ||
end |
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