Sha256: a787cd2ba3d749d464498aba02fe9bba4aa046051756fc8133e4415ecdac22ee

Contents?: true

Size: 347 Bytes

Versions: 2

Compression:

Stored size: 347 Bytes

Contents

# frozen_string_literal: true

class RactorPool::Worker
  def initialize(*args)
    Ractor.new(args) do |worker_id, jobs_pipe, _results_pipe, logger|
      # logger = Logger.new($stdout)
      jobs_pipe.subscribe do |data|
        logger.debug("Worker #{worker_id}: received data: #{data}")
        yield(data, logger)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ractor_pool-0.1.1 lib/ractor_pool/worker.rb
ractor_pool-0.1.0 lib/ractor_pool/worker.rb