Class: Dynflow::Actor

Inherits:
Concurrent::Actor::Context
  • Object
show all
Includes:
Algebrick::Matching, LogWithFullBacktrace, MethodicActor
Defined in:
lib/dynflow/actor.rb

Overview

Common parent for all the Dynflow actors defining some defaults that we preffer here.

Defined Under Namespace

Modules: LogWithFullBacktrace Classes: BacktraceCollector, PoliteTermination, SetResultsWithOriginLogging

Instance Method Summary collapse

Methods included from MethodicActor

#on_message

Methods included from LogWithFullBacktrace

#log

Instance Method Details

#behaviour_definitionObject



142
143
144
145
146
147
148
149
150
# File 'lib/dynflow/actor.rb', line 142

def behaviour_definition
  [*Concurrent::Actor::Behaviour.base(:just_log),
   Concurrent::Actor::Behaviour::Buffer,
   [SetResultsWithOriginLogging, :just_log],
   Concurrent::Actor::Behaviour::Awaits,
   PoliteTermination,
   Concurrent::Actor::Behaviour::ExecutesContext,
   Concurrent::Actor::Behaviour::ErrorsOnUnknownMessage]
end

#finish_terminationObject



133
134
135
136
# File 'lib/dynflow/actor.rb', line 133

def finish_termination
  @terminated.fulfill(true)
  reference.tell(:terminate!)
end

#start_termination(future) ⇒ Object



129
130
131
# File 'lib/dynflow/actor.rb', line 129

def start_termination(future)
  @terminated = future
end

#terminating?Boolean

Returns:

  • (Boolean)


138
139
140
# File 'lib/dynflow/actor.rb', line 138

def terminating?
  !!@terminated
end