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:



37
38
39
40
41
42
43
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 37

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



49
50
51
52
53
54
55
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 49

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

#idle(executor) ⇒ Object

Parameters:



29
30
31
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 29

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

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

Parameters:

Returns:



72
73
74
75
76
77
78
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 72

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



61
62
63
64
65
66
67
# File 'lib/karafka/pro/processing/jobs_builder.rb', line 61

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