quack_concurrency 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 367f0d058fbce805b9f2eb40c2905b21682da792df0d8d485aaf4e677bdee7b1
|
4
|
+
data.tar.gz: 0b598b37c585c3613dd6c423344160412cc2fc84d7afe5efad2c447473f3ee69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5516ea7ae5481ff84a9592f3e2df9419b285d22d3c2fd9563e31974a93b0725fa8944929f1d6fe6ca199c477b72d991b9af02caf46c9c89d41f2eed0b7d906d9
|
7
|
+
data.tar.gz: ffbf811448df7077667fdbc26f0e84a4ba6aa5b9e78c81afe7d163bd279d0a3cdb55b84818eeb080bdee875b9c8484a64f0043f3574b073ba7a7fb8b25814c7e
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Quack Concurrency
|
2
|
-
This Ruby Gem offers a few concurrency tools that could also be found in [*Concurrent Ruby*](https://github.com/ruby-concurrency/concurrent-ruby). However, all of *Quack Concurrency's* tools will
|
2
|
+
This Ruby Gem offers a few concurrency tools that could also be found in [*Concurrent Ruby*](https://github.com/ruby-concurrency/concurrent-ruby). However, all of *Quack Concurrency's* tools will tolerate duck types of Ruby's core classes to adjust the blocking behaviour of the tools. The tools include: `ConditionVariable`, `Future`, `Mutex`, `Queue`, `ReentrantMutex`, `UninterruptibleConditionVariable` and `UninterruptibleSleeper`. The tools will accept duck types for `Thread` and `Kernel`. *TODO: list some projects useing it*.
|
3
3
|
|
4
4
|
# Install
|
5
5
|
`gem install quack_concurrency`
|
@@ -1,4 +1,9 @@
|
|
1
1
|
module QuackConcurrency
|
2
|
+
|
3
|
+
# An {UninterruptibleSleeper} can be used to safely sleep a `Thread`.
|
4
|
+
# Unlike simply calling `Thread#sleep`, {#stop_thread} will ensure that only
|
5
|
+
# calling {#run_thread} on this {UninterruptibleSleeper} will wake the `Thread`.
|
6
|
+
# Any call to `Thread#run` directly, will be ignored.
|
2
7
|
class UninterruptibleSleeper
|
3
8
|
|
4
9
|
def self.for_current
|