class Falcon::ProxyEndpoint

An endpoint suitable for proxing requests, typically via a unix pipe.

Attributes

endpoint[R]

The actual endpoint for I/O. @attribute [Async::IO::Endpoint]

Public Class Methods

new(endpoint, **options) click to toggle source

Initialize the proxy endpoint. @parameter endpoint [Async::IO::Endpoint] The endpoint which will be used for connecting/binding.

Calls superclass method
# File lib/falcon/proxy_endpoint.rb, line 30
def initialize(endpoint, **options)
        super(**options)
        
        @endpoint = endpoint
end
unix(path, **options) click to toggle source

Create a proxy unix endpoint with the specific path. @returns [ProxyEndpoint]

# File lib/falcon/proxy_endpoint.rb, line 88
def self.unix(path, **options)
        self.new(::Async::IO::Endpoint.unix(path), **options)
end

Public Instance Methods

authority() click to toggle source

The authority to use for this endpoint. e.g. `“myapp.com”`. @returns [String]

# File lib/falcon/proxy_endpoint.rb, line 60
def authority
        @options[:authority]
end
bind(&block) click to toggle source

Bind to the endpoint.

# File lib/falcon/proxy_endpoint.rb, line 70
def bind(&block)
        @endpoint.bind(&block)
end
connect(&block) click to toggle source

Connect to the endpoint.

# File lib/falcon/proxy_endpoint.rb, line 65
def connect(&block)
        @endpoint.connect(&block)
end
each() { |class.new(endpoint, **options)| ... } click to toggle source

Enumerate the endpoint. If the endpoint has multiple underlying endpoints, this will enumerate them individually. @yields {|endpoint| …}

@parameter endpoint [ProxyEndpoint]
# File lib/falcon/proxy_endpoint.rb, line 78
def each
        return to_enum unless block_given?
        
        @endpoint.each do |endpoint|
                yield self.class.new(endpoint, **@options)
        end
end
protocol() click to toggle source

The protocol to use for this connection. @returns [Async::HTTP::Protocol] A specific protocol, e.g. {Async::HTTP::P}

# File lib/falcon/proxy_endpoint.rb, line 46
def protocol
        @options[:protocol]
end
scheme() click to toggle source

The scheme to use for this endpoint. e.g. `“http”`. @returns [String]

# File lib/falcon/proxy_endpoint.rb, line 53
def scheme
        @options[:scheme]
end
to_s() click to toggle source
# File lib/falcon/proxy_endpoint.rb, line 36
def to_s
        "\#<#{self.class} endpoint=#{@endpoint}>"
end