Last active
August 29, 2015 14:16
-
-
Save jbrisbin/cc6600d3cc63c442ea50 to your computer and use it in GitHub Desktop.
Sketch of Reactive Streams interfaces for Client/Server interaction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Channel<IN, OUT> extends Publisher<IN> { | |
Publisher<Boolean> write(Publisher<? extends OUT> data); | |
} | |
interface ClientSocketOptions { | |
SocketAddress connectAddress(); | |
boolean keepAlive(); | |
boolean reuseAddress(); | |
long rvcbuf(); | |
long sndbuf(); | |
} | |
interface Client<IN, OUT, CHAN extends Channel<IN, OUT>> { | |
Publisher<CHAN> connect(ClientSocketOptions opts); | |
Publisher<CHAN> connect(ClientSocketOptions opts, Publisher<Client<IN, OUT, CHAN>> reconnect); | |
Publisher<Boolean> close(); | |
<I, O, C extends Channel<I, O>> Client<I, O, C> intercept(Function<CHAN, C> fn); | |
} | |
interface Server<IN, OUT, CHAN extends Channel<IN, OUT>> { | |
Publisher<CHAN> start(); | |
Publisher<CHAN> shutdown(); | |
<I, O, C extends Channel<I, O>> Server<I, O, C> intercept(Function<CHAN, C> fn); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment