Network Layers
Where Rama
is different from most other typical Tower
user cases that we are aware of,
is that we wish to use service stacks across layers of the network.
You can read through the 'http service hello' example
to see this in effect in a minimal setup. There you can see how there are services on the tcp layer as well as the http layer,
and that the Context<State>
propagates through them all.
Abstract Example:
In rama it is truly Service
s all the way down.
Transport Layer Service Examples
All rama examples can be found in the /examples
dir.
Here are some examples that demonstrate working with transport layer services:
- /examples/tcp_listener_layers.rs: an example showing how to create a TCP listener with multiple layers of middleware;
- /examples/tcp_listener_hello.rs: a minimal example demonstrating a TCP listener that responds with a hello message;
- /examples/udp_codec.rs: an example showing how to work with UDP using codecs for message framing;