Class: RethinkDB::AsyncHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/nobrainer_streams/rethinkdb_monkeypatch.rb

Overview

Extend this class to define a new way of running rethinkdb queries asynchronously

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#callbackObject

The callback is set to be the user defined callback by the #async_run method



8
9
10
# File 'lib/nobrainer_streams/rethinkdb_monkeypatch.rb', line 8

def callback
  @callback
end

#connectionObject

Returns the value of attribute connection.



9
10
11
# File 'lib/nobrainer_streams/rethinkdb_monkeypatch.rb', line 9

def connection
  @connection
end

#optionsObject

Returns the value of attribute options.



10
11
12
# File 'lib/nobrainer_streams/rethinkdb_monkeypatch.rb', line 10

def options
  @options
end

Instance Method Details

#handlerObject

This method should return a handler that will deal with incoming messages



19
20
21
# File 'lib/nobrainer_streams/rethinkdb_monkeypatch.rb', line 19

def handler
  raise "Must override AsyncHandler#handler"
end

#run(&action) ⇒ Object

This method is called with a block that runs a rethinkdb connection synchronously



14
15
16
# File 'lib/nobrainer_streams/rethinkdb_monkeypatch.rb', line 14

def run(&action)
  raise "Must override AsyncHandler#run"
end