Sha256: 8a44448da529f531cb739c7a41809532be19ab6889566a2da0528f5d1293617f
Contents?: true
Size: 497 Bytes
Versions: 5
Compression:
Stored size: 497 Bytes
Contents
# frozen_string_literal: true module Zapp module SocketPipe class Receiver attr_reader(:pipe, :raw_tcp_pipe) def initialize(pipe:) @pipe = pipe @raw_tcp_pipe = Ractor.new(Zapp.config, name: "raw-tcp-pipe") do |config| server = TCPServer.new(config.host, config.port) loop do Ractor.yield(server.accept) end end end def take Ractor.select(pipe, raw_tcp_pipe)[1] end end end end
Version data entries
5 entries across 5 versions & 1 rubygems