Module: RocketChat::Realtime

Defined in:
lib/rocket_chat/realtime.rb,
lib/rocket_chat/realtime/client.rb,
lib/rocket_chat/realtime/adapter.rb,
lib/rocket_chat/realtime/message.rb,
lib/rocket_chat/realtime/reactor.rb,
lib/rocket_chat/realtime/version.rb,
lib/rocket_chat/realtime/connector.rb,
lib/rocket_chat/realtime/async_task.rb,
lib/rocket_chat/realtime/dispatcher.rb,
lib/rocket_chat/realtime/methods/auth.rb,
lib/rocket_chat/realtime/event_emitter.rb,
lib/rocket_chat/realtime/handlers/base.rb,
lib/rocket_chat/realtime/handlers/ready.rb,
lib/rocket_chat/realtime/handlers/result.rb,
lib/rocket_chat/realtime/messages/method.rb,
lib/rocket_chat/realtime/messages/result.rb,
lib/rocket_chat/realtime/methods/message.rb,
lib/rocket_chat/realtime/handlers/changed.rb,
lib/rocket_chat/realtime/messages/changed.rb,
lib/rocket_chat/realtime/messages/subscribe.rb,
lib/rocket_chat/realtime/subscriptions/room.rb

Overview

RocketChat Realtiem API

The Realtime API is depend on Metero.js DDP github.com/meteor/meteor/blob/devel/packages/ddp/DDP.md

Since:

  • 0.1.0

Defined Under Namespace

Modules: EventEmitter, Handlers, Messages, Methods, Subscriptions Classes: Adapter, AsyncTask, Client, Connector, Dispatcher, Message, Reactor

Constant Summary collapse

VERSION =

Since:

  • 0.1.0

'0.1.1'

Class Method Summary collapse

Class Method Details

.connect(options = {}) ⇒ RocketChat::Realtime::Client

Connect to RocketChat

Parameters:

  • options (Hash) (defaults to: {})

    connection options

Returns:

Since:

  • 0.1.0



51
52
53
54
55
56
# File 'lib/rocket_chat/realtime.rb', line 51

def connect(options = {})
  client = Client.new(options)
  client.connect
  Reactor.run
  client
end

.loggerLogger

Logger

Returns:

  • (Logger)

Since:

  • 0.1.0



30
31
32
33
# File 'lib/rocket_chat/realtime.rb', line 30

def logger
  @logger ||=
    Logger.new(STDERR, progname: name, level: Logger::ERROR)
end

.logger=(logger) ⇒ Object

Set logger

Parameters:

  • logger (Logger)

Since:

  • 0.1.0



40
41
42
# File 'lib/rocket_chat/realtime.rb', line 40

def logger=(logger)
  @logger = logger
end