Sha256: 77255fbcd1b5f7205ed170b0a9ed33476442b6b77d150e069e55bed06742c771
Contents?: true
Size: 1.03 KB
Versions: 35
Compression:
Stored size: 1.03 KB
Contents
module Concurrent module Actor module Behaviour class Supervising < Abstract def initialize(core, subsequent, handle, strategy) super core, subsequent @handle = Match! handle, :terminate!, :resume!, :reset!, :restart! @strategy = case @handle when :terminate! Match! strategy, nil when :resume! Match! strategy, :one_for_one when :reset!, :restart! Match! strategy, :one_for_one, :one_for_all end end def on_envelope(envelope) case envelope.message when Exception, :paused receivers = if @strategy == :one_for_all children else [envelope.sender] end receivers.each { |ch| ch << @handle } else pass envelope end end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems