Sha256: 851f8d6f8065cf58862d3b681d7e2c2987d1d64c6c25db8c0940f0eaafe573ff
Contents?: true
Size: 446 Bytes
Versions: 20
Compression:
Stored size: 446 Bytes
Contents
require 'concurrent/maybe' module Concurrent class Channel class Selector class TakeClause def initialize(channel, block) @channel = channel @block = block end def execute if (result = @channel.poll?).just? Concurrent::Maybe.just(@block.call(result.value)) else Concurrent::Maybe.nothing end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems