Module: Mailbox

Includes:
Synchronized
Defined in:
lib/mailbox.rb,
lib/daemon_thread_factory.rb

Defined Under Namespace

Modules: ClassMethods Classes: DaemonThreadFactory

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.raise_exceptions_immediatelyObject

Used to tell Mailbox that all mailslot methods should be run on the calling thread.

*** Intended for synchronous unit testing of concurrent apps***



41
42
43
# File 'lib/mailbox.rb', line 41

def raise_exceptions_immediately
  @raise_exceptions_immediately
end

.synchronousObject

Used to tell Mailbox that all mailslot methods should be run on the calling thread.

*** Intended for synchronous unit testing of concurrent apps***



41
42
43
# File 'lib/mailbox.rb', line 41

def synchronous
  @synchronous
end

Instance Method Details

#__queue_depth__Object



55
56
57
# File 'lib/mailbox.rb', line 55

def __queue_depth__
  __queue_counter__.get
end

#__thread_name__Object



59
60
61
# File 'lib/mailbox.rb', line 59

def __thread_name__
  @__thread_name__ ||= "#{self.class.name} #{self.object_id} Mailbox"
end

#disposeObject



32
33
34
# File 'lib/mailbox.rb', line 32

def dispose
  __fiber__.dispose
end

#register_channel(channel_name, channel) ⇒ Object

Register your jretlang channel as a named channel



21
22
23
24
25
26
# File 'lib/mailbox.rb', line 21

def register_channel(channel_name, channel)
  channel_registry = self.class.__channel_registry__
  channel_registry.select { |k,v| v[:channel] == channel_name }.each do |k,v|
    v[:replyable] ? (channel, k) : (channel, k)
  end
end

#verbose_output_to(method_name) ⇒ Object



28
29
30
# File 'lib/mailbox.rb', line 28

def verbose_output_to method_name
  @__verbose_target__ = method_name
end