Class: ZeevexConcurrency::EventLoop::Null

Inherits:
Object
  • Object
show all
Defined in:
lib/zeevex_concurrency/event_loop.rb

Overview

event loop which throws away all events without running, returning nil from all promises

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Null

Returns a new instance of Null.



127
# File 'lib/zeevex_concurrency/event_loop.rb', line 127

def initialize(options = {}); end

Instance Method Details

#enqueue(callable = nil, &block) ⇒ Object



130
131
132
133
134
# File 'lib/zeevex_concurrency/event_loop.rb', line 130

def enqueue(callable = nil, &block)
  to_run = ZeevexConcurrency::Promise.new unless to_run.is_a?(ZeevexConcurrency::Delayed)
  to_run.set_result { nil }
  to_run
end

#in_event_loop?Boolean

Returns:

  • (Boolean)


135
# File 'lib/zeevex_concurrency/event_loop.rb', line 135

def in_event_loop?; false; end

#on_event_loop(runnable = nil, &block) ⇒ Object



136
137
138
# File 'lib/zeevex_concurrency/event_loop.rb', line 136

def on_event_loop(runnable = nil, &block)
  enqueue(runnable, &block)
end

#startObject



128
# File 'lib/zeevex_concurrency/event_loop.rb', line 128

def start; end

#stopObject



129
# File 'lib/zeevex_concurrency/event_loop.rb', line 129

def stop; end