Class: Mammoth::Runtimes::ConcurrentAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/mammoth/runtimes/concurrent_adapter.rb

Overview

Runtime adapter backed by Mammoth's existing cdc-concurrent wrapper.

Class Method Summary collapse

Methods inherited from Adapter

capabilities, #initialize

Constructor Details

This class inherits a constructor from Mammoth::Runtimes::Adapter

Class Method Details

.adapter_typeString

Returns adapter type name.

Returns:

  • (String)

    adapter type name



9
10
11
# File 'lib/mammoth/runtimes/concurrent_adapter.rb', line 9

def adapter_type
  "concurrent"
end

.build(processor:, concurrency:, timeout:, preserve_order:) ⇒ Mammoth::ConcurrentDeliveryRuntime

Build a concurrent runtime adapter.

Parameters:

  • processor (#process)

    delivery processor

  • concurrency (Integer)

    worker count

  • timeout (Numeric, nil)

    optional timeout

  • preserve_order (Boolean)

    preserve ordering when supported

Returns:



20
21
22
23
24
25
26
27
# File 'lib/mammoth/runtimes/concurrent_adapter.rb', line 20

def build(processor:, concurrency:, timeout:, preserve_order:)
  ConcurrentDeliveryRuntime.new(
    processor: processor,
    concurrency: concurrency,
    timeout: timeout,
    preserve_order: preserve_order
  )
end