Module: Protocol::HTTP::Executor::Transport

Defined in:
lib/protocol/http/executor/transport.rb

Overview

A per-request transport with independent control and full-duplex body channels.

Defined Under Namespace

Classes: Endpoint

Class Method Summary collapse

Class Method Details

.pairObject

Create connected client and worker transport endpoints.



40
41
42
43
44
45
46
47
48
# File 'lib/protocol/http/executor/transport.rb', line 40

def self.pair
	client_control, worker_control = Socket.pair(:UNIX, :STREAM, 0)
	client_body, worker_body = Socket.pair(:UNIX, :STREAM, 0)
	
	client = Endpoint.new(client_control, client_body)
	worker = [worker_control, worker_body]
	
	return client, worker
end