Sha256: ad2961e26d33e5c8a5ec6ad4c51be5e69d5d9c76d01e729fcbc4880a04570f91
Contents?: true
Size: 1.1 KB
Versions: 47
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true module Karafka # Allows to start and stop Karafka as part of a different process module Embedded class << self # Starts Karafka without supervision and without ownership of signals in a background thread # so it won't interrupt other things running def start Thread.new do Karafka::Process.tags.add(:execution_mode, 'embedded') Karafka::Server.start end end # Stops Karafka upon any event # # @note This method is blocking because we want to wait until Karafka is stopped with final # process shutdown def stop # Stop needs to be blocking to wait for all the things to finalize Karafka::Server.stop end # Quiets Karafka upon any event # # @note This method is not blocking and will not wait for Karafka to fully quiet. # It will trigger the quiet procedure but won't wait. # # @note Please keep in mind you need to `#stop` to actually stop the server anyhow. def quiet Karafka::Server.quiet end end end end
Version data entries
47 entries across 47 versions & 1 rubygems