Commit Graph

551 Commits

Author SHA1 Message Date
Tim
f9ff2c4e50 Merge pull request #121 from tikue/send-client
Make SyncClient Send again (and Clone too!).
2017-03-06 22:12:33 -08:00
Tim Kuehn
073bc25e18 Derive debug rather than manually impl 2017-03-06 21:12:44 -08:00
Tim Kuehn
d0d65c413a Make Client Send again (and Clone too!).
The basic strategy is to start a reactor on a dedicated thread running a request stream.
Requests are spawned onto the reactor, allowing multiple requests to be
processed concurrently. For example, if you clone the client to make requests
from multiple threads, they won't have to wait for each others'
requests to complete before theirs start being sent out.

Also, client rpcs only take &self now, which was also required for
clients to be usable in a service.

Also added a test to prevent regressions.
2017-03-06 21:12:44 -08:00
Tim
e59116fb48 Add server::Handle::shutdown (#117)
* Add server::Handle::shutdown
* Hybrid approach: lameduck + total shutdown when all clients disconnect.
* The future handle has addr() and shutdown(), but not run().
2017-03-06 20:57:12 -08:00
Tim
daa96a69a2 Latency benchmark: drive the client with the same reactor as server (so it's entirely single-threaded) (#116) 2017-02-22 21:46:28 -08:00
Tim
85ae614983 Add a test that dropping a client doesn't break the server (#115) 2017-02-22 21:12:52 -08:00
Adam Wright
e17549a1f7 Merge pull request #114 from shaladdle/fix-throughput
Fix throughput example
2017-02-21 22:39:51 -08:00
Adam Wright
0b8a845ec1 Actually run the server future 2017-02-21 22:24:05 -08:00
Tim
2b8f3db1fd Return a concrete type from server::listen (#113)
* Return a concrete type from `server::listen`.
* Change `FutureServiceExt::listen` to return `(SocketAddr, Listen)`, where `Listen` is a struct created by the `service!` macro that `impls Future<Item=(),  Error=()>` and represents server execution.
* Disable `conservative_impl_trait` as it's no longer used.
* Update `FutureServiceExt` doc comment.
* Update `SyncServiceExt` doc comment. Also annotate `server::Handle` with `#[must_use]`.
* `cargo fmt`
2017-02-21 22:01:59 -08:00
Adam Wright
44792347b1 Change sync listen to return a handle which runs the server (#112) 2017-02-21 09:50:01 -08:00
Adam Wright
f7c371930f Merge pull request #110 from shaladdle/prepush
Prepush script improvement/simplification
2017-02-20 18:43:51 -08:00
Adam Wright
3eec8fe1dd Actually fail the prepush in try_run 2017-02-20 18:10:23 -08:00
Adam Wright
9c973eb80b Switch back to verb_ing_ 2017-02-20 18:07:36 -08:00
Adam Wright
37763f25e4 Make whitespace consistent 2017-02-20 17:46:13 -08:00
Adam Wright
515ab90299 Various simplifications/improvements to pre-push 2017-02-20 17:44:30 -08:00
Adam Wright
9987eae290 --color=always has to be after the command 2017-02-20 17:11:05 -08:00
Adam Wright
22545c653c Fix prepush script? 2017-02-20 17:11:05 -08:00
Cyril Plisko
8b9847e347 Update chrono (#111) 2017-02-20 13:05:47 -08:00
Adam Wright
49bc4d0bce Merge pull request #109 from shaladdle/formatting
Run cargo fmt
2017-02-18 22:37:27 -08:00
Adam Wright
0780af9e05 Run cargo fmt 2017-02-18 15:37:31 -08:00
Adam Wright
bc16ffd2d0 Merge pull request #108 from tikue/doc-fix
Fix readme, but for real this time.
2017-02-16 21:08:01 -08:00
Tim Kuehn
c7831e8aa6 More spacing stuff 2017-02-16 20:56:04 -08:00
Tim Kuehn
8faba59d66 Fix tabs in pre-push, and remove dead code in readme 2017-02-16 20:51:57 -08:00
Tim Kuehn
bceaea1206 .travis.yml: Do tls tests, then rustdoc tests, then regular tests 2017-02-16 20:18:46 -08:00
Tim Kuehn
fea8d5eb1d I hate READMEs. 2017-02-16 17:57:17 -08:00
Tim Kuehn
db9c23058d Dumb thing 2017-02-16 17:53:59 -08:00
Tim Kuehn
77638b388d Have travis test README with rustdoc. Yay! 2017-02-16 17:53:06 -08:00
Tim Kuehn
eac6b64aeb Merge branch 'master' of github.com:google/tarpc into doc-fix 2017-02-16 17:52:21 -08:00
Tim Kuehn
7ae107cf2b Fix readme for real this time. 2017-02-16 17:46:55 -08:00
Adam Wright
12efcae80c Merge pull request #107 from tikue/master
Fix README future service examples
2017-02-16 16:22:48 -08:00
Adam Wright
5fbd45ea49 Merge branch 'master' into master 2017-02-16 14:43:20 -08:00
Tim Kuehn
e651838f19 remove unused thing 2017-02-16 13:41:13 -08:00
Adam Wright
cdb44090bd Merge pull request #106 from tikue/pre-push-bench
Add bench to pre-push and .travis.yml
2017-02-16 12:43:19 -08:00
Tim Kuehn
fc2edc89af Fix README future service examples 2017-02-16 12:07:49 -08:00
Tim Kuehn
30eed41c40 Unused imports 2017-02-16 01:04:40 -08:00
Tim Kuehn
517477129c Remove dead code 2017-02-16 01:00:40 -08:00
Tim Kuehn
1325d1a2d7 Merge branch 'master' of github.com:google/tarpc into pre-push-bench 2017-02-16 00:59:34 -08:00
Adam Wright
15f83961e9 Merge pull request #98 from tikue/into-future
Change bound on FutureService's associated types
2017-02-16 00:58:06 -08:00
Tim Kuehn
4fc37fe707 Add bench to pre-push and .travis.yml 2017-02-16 00:56:38 -08:00
Tim Kuehn
8ee6ce0307 Update README 2017-02-16 00:51:55 -08:00
Tim Kuehn
07f9d5a34d Merge branch 'master' of github.com:google/tarpc into into-future 2017-02-16 00:50:08 -08:00
Adam Wright
a0a11f8704 Merge pull request #97 from tikue/crates-io-categories
Add categories to Cargo.toml.
2017-02-16 00:46:55 -08:00
Tim Kuehn
6673869721 Merge branch 'master' of github.com:google/tarpc into tikue/crates-io-categories 2017-02-16 00:40:11 -08:00
Tim Kuehn
63caacf0c1 Merge branch master into tikue/into-future. 2017-02-16 00:37:19 -08:00
Tim
2c09a35705 Remove the Send bound from FutureService (#96)
* Make a reactor handle mandatory for server.

This removes the Send bound from FutureService. The Send bound
is still required for SyncService, since clones are sent to
new threads for each request. (This is more fodder for the argument
that there should be a distinct Options struct for each combination of
async/sync and client/server.)

This commit also makes FutureService::listen return an io::Result
rather than a Future; the future was never really necessary and
had the unintended consequence of making SyncService::listen
deadlock when the options specified a handle (because that means
the reactor driving the service lives on the same thread that
SyncService is waiting on).

`SyncClient` is no longer `Clone` because it needs to create
a new `reactor::Core` when cloning. Tokio Clients are `Clone` but
they don't allow moving the cloned client onto a new reactor.

* Change pubsub to use Rc<Refcell<>> instead of Arc<Mutex<>>.

This is possible since services no longer need to be Send.

* Remove some unnecessary unstable features.

There 3 remaining unstable features. The hardest to remove is plugin, because
we rely on compiler plugins to rewrite types from snake case to camel. It's
possible this can be removed before the proc macros rewrite lands if
impl Trait is extended to work with traits.

* Clean up example

* Sync servers now spawn a reactor on a thread. It's decided that
   sync users should not have to know about tokio at all.

* Don't allow specifying a reactor::Core on client options.

* Fail fast in server::listen if local_addr() returns Err.
2017-02-15 23:47:35 -08:00
Adam Wright
6bf4d171c1 Merge pull request #99 from tikue/deps-cleanup
Remove unused deps: bytes, take, and scoped-pool
2017-02-15 20:57:08 -08:00
Adam Wright
0f52b08426 Merge branch 'master' into deps-cleanup 2017-02-15 20:49:53 -08:00
Cyril Plisko
acdf03c8ca Fix compilation error for benches (#101) 2017-02-15 09:26:57 -08:00
Adam Wright
b2f69faa13 Merge pull request #92 from tikue/sync-reactor
Change SyncClient to drive its own execution with an internal reactor::Core.
2017-02-13 21:37:49 -08:00
Tim Kuehn
2749d33f88 Merge master into sync-reactor. 2017-02-13 21:29:39 -08:00