Class: Karafka::Pro::Processing::JobsBuilder

Inherits:
Karafka::Processing::JobsBuilder show all
Defined in:
lib/karafka/pro/processing/jobs_builder.rb

Overview

Pro jobs builder that supports lrj

Instance Method Summary collapse

Methods inherited from Karafka::Processing::JobsBuilder

#shutdown

Instance Method Details

#consume(executor, messages) ⇒ Karafka::Processing::Jobs::Consume, Karafka::Pro::Processing::Jobs::ConsumeNonBlocking

Parameters:

Returns:



20
21
22
23
24
25
26
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 20

def consume(executor, messages)
  if executor.topic.long_running_job?
    Jobs::ConsumeNonBlocking.new(executor, messages)
  else
    super
  end
end

#eofed(executor) ⇒ Karafka::Processing::Jobs::Eofed, Karafka::Processing::Jobs::EofedBlocking

Parameters:

Returns:

  • (Karafka::Processing::Jobs::Eofed)

    eofed job for non LRJ

  • (Karafka::Processing::Jobs::EofedBlocking)

    eofed job that is non-blocking, so when revocation job is scheduled for LRJ it also will not block



32
33
34
35
36
37
38
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 32

def eofed(executor)
  if executor.topic.long_running_job?
    Jobs::EofedNonBlocking.new(executor)
  else
    super
  end
end

#idle(executor) ⇒ Object

Parameters:



12
13
14
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 12

def idle(executor)
  Karafka::Processing::Jobs::Idle.new(executor)
end

#periodic(executor) ⇒ Jobs::Periodic, Jobs::PeriodicNonBlocking

Parameters:

Returns:



55
56
57
58
59
60
61
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 55

def periodic(executor)
  if executor.topic.long_running_job?
    Jobs::PeriodicNonBlocking.new(executor)
  else
    Jobs::Periodic.new(executor)
  end
end

#revoked(executor) ⇒ Karafka::Processing::Jobs::Revoked, Karafka::Processing::Jobs::RevokedNonBlocking

Parameters:

Returns:

  • (Karafka::Processing::Jobs::Revoked)

    revocation job for non LRJ

  • (Karafka::Processing::Jobs::RevokedNonBlocking)

    revocation job that is non-blocking, so when revocation job is scheduled for LRJ it also will not block



44
45
46
47
48
49
50
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 44

def revoked(executor)
  if executor.topic.long_running_job?
    Jobs::RevokedNonBlocking.new(executor)
  else
    super
  end
end