[−][src]Function interledger_btp::create_btp_service_and_filter
pub fn create_btp_service_and_filter<O, S, A>(
ilp_address: Address,
store: S,
next_outgoing: O
) -> (BtpOutgoingService<O, A>, BoxedFilter<(impl Reply,)>) where
O: OutgoingService<A> + Clone + Send + Sync + 'static,
S: BtpStore<Account = A> + Clone + Send + Sync + 'static,
A: BtpAccount + 'static,
Returns a BtpOutgoingService and a warp Filter.
The BtpOutgoingService wraps all BTP/WebSocket connections that come
in on the given address. Calling handle_incoming
with an IncomingService
will
turn the returned BtpOutgoingService into a bidirectional handler.
The separation is designed to enable the returned BtpOutgoingService to be passed
to another service like the Router, and then for the Router to be passed as the
IncomingService to the BTP server.
The warp filter handles the websocket upgrades and adds incoming connections to the BTP service so that it will handle each of the messages.