Sha256: aed060bf1028ddd03bebfca57349be9264f7757cb44c5a5d0df78004d5331c07

Contents?: true

Size: 325 Bytes

Versions: 3

Compression:

Stored size: 325 Bytes

Contents

# frozen_string_literal: true

module MultiProcess
  # Receiver implementation storing process output
  # in string.
  #
  class StringReceiver < Receiver
    def received(_process, name, message)
      get(name) << message
    end

    def get(name)
      @strings ||= {}
      @strings[name.to_s] ||= +''
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
multi_process-1.3.0 lib/multi_process/string_receiver.rb
multi_process-1.2.1 lib/multi_process/string_receiver.rb
multi_process-1.2.0 lib/multi_process/string_receiver.rb