package conduit-lwt
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=5ea8d2d9a5fe69d909083b40b8ebbee2e2b39e8bb5428dc43c5e7a11081f69de
sha512=5d58479873a06107ea7eeaba7444018e7a09135cc1a6f1fd813aa8279823ceb5f6cf613b5d2573f72e40eeaec9ab651c3e6d4e1f5dcacd95c46a91232c9b5873
doc/conduit-lwt/Resolver_lwt/index.html
Module Resolver_lwt
Source
Resolve URIs to endpoints using the Lwt library
IO module compatible with Conduit.IO
that uses Lwt
Module type that specialises Conduit.RESOLVER
to use Lwt threads
include S
Abstract type of the cooperative threading library used, normally defined via the IO
module type
State handle for a running resolver
Abstract type for a service entry, which maps a URI scheme into a protocol handler and TCP port
A rewrite function resolves a service and a URI into a concrete endpoint.
f ++ g
is the composition of the service functions f
and g
.
init ?service ?rewrites
will initialize the resolver and return a state handler. The service argument should contain the system-specific resolution mechanism for URI schemas.
The rewrites
argument can optionally override a subset of the URI domain name with the given rewrite_fn
to permit custom resolution rules. For example, a rewrite rule for ".xen" would let the rewrite function resolve hostnames such as "foo.xen" into a shared memory channel for the "foo" virtual machine.
add_rewrite ~host f t
will add to the t
resolver the f
rewrite rule for all the domain names that shortest-prefix match host
service t
is the function which is called when trying to resolve a hostname with t
.
resolve_uri ?rewrites ~uri t
will use t
to resolve the uri
into a concrete endpoint. Any rewrites
that are passed in will be overlayed on the existing rules within the t
resolver, but not otherwise modify it.