Class: Concurrent::Edge::Channel
- Inherits:
-
Synchronization::Object
- Object
- Synchronization::Object
- Concurrent::Edge::Channel
- Defined in:
- lib/concurrent/edge/future.rb
Overview
Note:
proof of concept
Instance Method Summary collapse
-
#initialize ⇒ Channel
constructor
TODO make lock free.
- #inspect ⇒ Object
- #pop ⇒ Object
- #probe_set_size ⇒ Object
- #push(value) ⇒ Object
- #select(probe) ⇒ Object
Constructor Details
#initialize ⇒ Channel
TODO make lock free
1377 1378 1379 1380 1381 |
# File 'lib/concurrent/edge/future.rb', line 1377 def initialize super @ProbeSet = Concurrent::Channel::WaitableList.new ensure_ivar_visibility! end |
Instance Method Details
#inspect ⇒ Object
1401 1402 1403 |
# File 'lib/concurrent/edge/future.rb', line 1401 def inspect to_s end |
#pop ⇒ Object
1392 1393 1394 |
# File 'lib/concurrent/edge/future.rb', line 1392 def pop select(Concurrent.future) end |
#probe_set_size ⇒ Object
1383 1384 1385 |
# File 'lib/concurrent/edge/future.rb', line 1383 def probe_set_size @ProbeSet.size end |
#push(value) ⇒ Object
1387 1388 1389 1390 |
# File 'lib/concurrent/edge/future.rb', line 1387 def push(value) until @ProbeSet.take.try_success([value, self]) end end |
#select(probe) ⇒ Object
1396 1397 1398 1399 |
# File 'lib/concurrent/edge/future.rb', line 1396 def select(probe) @ProbeSet.put(probe) probe end |