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:, observer: CDC::Core::Observer.new) ⇒ 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

  • observer (CDC::Core::Observer) (defaults to: CDC::Core::Observer.new)

    dispatch lifecycle observer

Returns:



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

def build(processor:, concurrency:, timeout:, preserve_order:, observer: CDC::Core::Observer.new)
  ConcurrentDeliveryRuntime.new(
    processor: processor,
    concurrency: concurrency,
    timeout: timeout,
    preserve_order: preserve_order,
    observer: observer
  )
end