Class: Skein::Client

Inherits:
Connected show all
Defined in:
lib/skein/client.rb

Defined Under Namespace

Classes: Publisher, RPC, Subscriber, Worker

Instance Attribute Summary

Attributes inherited from Connected

#channel, #connection, #context, #ident

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Connected

#close, #lock

Constructor Details

#initialize(connection: nil, context: nil) ⇒ Client

Instance Methods =====================================================



27
28
29
# File 'lib/skein/client.rb', line 27

def initialize(connection: nil, context: nil)
  super(connection: connection, context: context)
end

Class Method Details

.publisher(*args) ⇒ Object



17
18
19
# File 'lib/skein/client.rb', line 17

def self.publisher(*args)
  new.publisher(*args)
end

.receiver(*args) ⇒ Object



13
14
15
# File 'lib/skein/client.rb', line 13

def self.receiver(*args)
  new.receiver(*args)
end

.rpc(*args) ⇒ Object

Class Methods ========================================================



9
10
11
# File 'lib/skein/client.rb', line 9

def self.rpc(*args)
  new.rpc(*args)
end

.subscriber(*args) ⇒ Object



21
22
23
# File 'lib/skein/client.rb', line 21

def self.subscriber(*args)
  new.subscriber(*args)
end

Instance Method Details

#publisher(queue_name) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/skein/client.rb', line 47

def publisher(queue_name)
  Skein::Client::Publisher.new(
    queue_name,
    connection: self.connection,
    context: self.context
  )
end

#receiverObject



40
41
42
43
44
45
# File 'lib/skein/client.rb', line 40

def receiver
  Skein::Client::Receiver.new(
    connection: self.connection,
    context: self.context
  )
end

#rpc(exchange_name = nil, routing_key: nil) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/skein/client.rb', line 31

def rpc(exchange_name = nil, routing_key: nil)
  Skein::Client::RPC.new(
    exchange_name,
    routing_key: routing_key,
    connection: self.connection,
    context: self.context
  )
end

#subscriber(queue_name, routing_key = nil) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/skein/client.rb', line 55

def subscriber(queue_name, routing_key = nil)
  Skein::Client::Subscriber.new(
    queue_name,
    routing_key,
    connection: self.connection,
    context: self.context
  )
end