Module: ETLBase

Included in:
ETLConsumer, ETLProducer
Defined in:
lib/actors/etl_base.rb

Overview

Methods shared between ETLConsumer and ETLProducer modules.

Instance Method Summary collapse

Instance Method Details

#empty?Boolean

Checks whether an actor is currently "empty", meaning it can not produce any more output.


31
32
33
# File 'lib/actors/etl_base.rb', line 31

def empty?
  @_empty
end

#eof_received?Boolean


4
5
6
# File 'lib/actors/etl_base.rb', line 4

def eof_received?
  @_eof_received || false
end

#loggerObject


14
15
16
# File 'lib/actors/etl_base.rb', line 14

def logger
  @_logger ||= Logging.logger[self]
end

#mark_empty!Object

Sets the "empty" state for an actor. Actor should be empty when it can't produce any more rows from the input it has already received.


20
21
22
# File 'lib/actors/etl_base.rb', line 20

def mark_empty!
  @_empty = true
end

#receive_eofObject

Receive EOF signal from actor's source(s).


9
10
11
12
# File 'lib/actors/etl_base.rb', line 9

def receive_eof
  logger.debug "Receiving EOF to #{self.class.name} (#{Thread.current.object_id})."
  process_eof if respond_to? :process_eof
end

#unmark_empty!Object

Resets the "empty" state for an actor. Actor is not empty, when it can produce more rows from the input it has already received.


26
27
28
# File 'lib/actors/etl_base.rb', line 26

def unmark_empty!
  @_empty = false
end