Module: Moleculer::Transporters

Defined in:
lib/moleculer/transporters.rb,
lib/moleculer/transporters/base.rb,
lib/moleculer/transporters/fake.rb,
lib/moleculer/transporters/redis.rb

Overview

A transporter is the method by which moleculer transports information from one service to the next. Transporters can be created using any over-the-wire bus that can be made to support some level of queueing (i.e. Redis, NATS, Kafka)

Defined Under Namespace

Classes: Base, Fake, Redis

Class Method Summary collapse

Class Method Details

.for(uri) ⇒ Moleculer::Transporters::Base

Returns a new transporter for the provided transporter uri

Parameters:

  • uri (String)

    the transporter uri

  • broker (Moleculer::Broker)

    the broker instance

Returns:



16
17
18
19
20
# File 'lib/moleculer/transporters.rb', line 16

def self.for(uri)
  parsed = URI(uri)
  require_relative("./transporters/#{parsed.scheme}")
  const_get(parsed.scheme.split("_").map(&:capitalize).join)
end