Organize tests
For some reason the tests in this module bother me. I tried to make it a little clearer what the reasoning behind each one is, and I removed some that were no longer necessary.
See merge request !24
Factor out serialization code into a Serialize and Deserialize trait
Makes the client and server code a bit nicer by sharing commonalities between them.
See merge request !20
Remove the struct InflightRpcs.
We were previously doing a lot of accounting to make sure the server never exits before all open connection handlers. However, now that we're using scoped threads, that's taken care of by the scoped library, and we were essentially doing redundant work.
See merge request !19
Refactor the macro
1. Rename `rpc!` ==> `service!`
2. Rip out the module-related parts.
The end result is that, in the common case, there will be one level of indentation less. In some cases, there will be two levels less. The module parts had no benefit over simply scoping the macro invocation within a module.
The macro was renamed because this looks bad:
```rust
rpc! {
rpc hello(s: String) -> String;
}
```
And I think `service!` better describes what is expanded.
See merge request !16
Add an AsyncClient generated by rpc!
Returns `Future<T>` instead of `Result<T>`. `Future<T>` has one method, `get()`, which returns a `Result<T>`.
See merge request !15
We were previously doing a lot of accounting to make sure the server never exits
before all open connection handlers. However, now that we're using scoped threads,
that's taken care of by the scoped library, and we were essentially doing redundant
work.
1. Use a scoped thread pool instead of crossbeam. It uses crossbeam under the hood but doesn't spawn endless threads.
Hardcoded to 100 threads currently, but we can play with that.
2. Buffer IO. Seems to improve performance.
3. Shuffle around where the stream's timeouts are set. I think they should only need to be set once.