Class: Karafka::Web::Pro::Commanding::Matchers::ProcessId
- 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
-
#apply? ⇒ Boolean
True if process_id criterion is specified in matchers.
-
#matches? ⇒ Boolean
True if process ID matches.
Methods inherited from Base
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.
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.
46 47 48 |
# File 'lib/karafka/web/pro/commanding/matchers/process_id.rb', line 46 def matches? process_id == current_process_id end |