Class: MessageBusClientWorker::Poll

Inherits:
Object
  • Object
show all
Extended by:
LightService::Organizer
Defined in:
lib/message_bus_client_worker/services/poll.rb

Class Method Summary collapse

Class Method Details

.call(host, subscriptions, long) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/message_bus_client_worker/services/poll.rb', line 6

def self.call(host, subscriptions, long)
  with(
    host: host,
    subscriptions: subscriptions,
    long: long,
  ).reduce(
    Polling::GenerateClientId,
    Polling::GenerateURI,
    execute(->(c) { c[:headers] = c[:subscriptions][:headers] }),
    Polling::GenerateParams,
    Polling::GetPayloads,
    iterate(:payloads, [
      Polling::ProcessPayload,
    ])
  )
end