Class: Nonnative::Proxy
- Inherits:
-
Object
- Object
- Nonnative::Proxy
- Defined in:
- lib/nonnative/proxy.rb
Overview
Parent type for proxy implementations.
A proxy is responsible for interposing behavior between a client and a target service.
Runtime services create a proxy instance via ProxyFactory based on service.proxy.kind.
Service configuration host and port are the client-facing endpoint. Concrete proxy methods are
implementation-specific; for example FaultInjectionProxy#host and
FaultInjectionProxy#port return the upstream target behind the proxy.
Custom proxies must accept the service configuration in initialize and implement these public
methods, which the service and pool invoke unconditionally:
start: begin proxying (bind/listen, start threads, etc)stop: stop proxying and release resourcesreset: return proxy behavior to a healthy/default state
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(service) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(service) ⇒ Proxy
Returns a new instance of Proxy.
24 25 26 |
# File 'lib/nonnative/proxy.rb', line 24 def initialize(service) @service = service end |