Class: Karafka::Web::Pro::Commanding::Matchers::ProcessId

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/pro/commanding/matchers/process_id.rb

Overview

Matcher that checks if the current process ID matches the specified process ID in the matchers hash. This is an optional matcher that only applies when process_id is specified in the matchers.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Pro::Commanding::Matchers::Base

Instance Method Details

#apply?Boolean

Returns true if process_id criterion is specified in matchers.

Returns:

  • (Boolean)

    true if process_id criterion is specified in matchers



41
42
43
# File 'lib/karafka/web/pro/commanding/matchers/process_id.rb', line 41

def apply?
  !process_id.nil?
end

#matches?Boolean

Returns true if process ID matches.

Returns:

  • (Boolean)

    true if process ID matches



46
47
48
# File 'lib/karafka/web/pro/commanding/matchers/process_id.rb', line 46

def matches?
  process_id == current_process_id
end