Commit Graph

771 Commits

Author SHA1 Message Date
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
compressed
338c91d393 fix(bincode): updates to support bincode 1.0.0-alpha2 (#100)
Removed:
- `Error::ClientDeserialize` variant
- `Error::ServerDeserialize` variant
- `WireError::ServerDeserialize` variant
2017-02-12 14:52:38 -08:00
Tim Kuehn
fa2df184e9 Remove unused deps: bytes, take, and scoped-pool 2017-02-07 20:34:52 -08:00
Tim Kuehn
fe4eab38f1 Change FutureService's associated types to be bounded by IntoFuture rather than Future.
It's strictly more flexible, because everything that impls Future impls IntoFuture, and it
additionally allows returning types like Result. Which is nice.
2017-02-07 19:58:29 -08:00
Tim Kuehn
06beec3e5a Add keywords that aren't terrible 2017-02-06 19:24:35 -08:00
Tim Kuehn
d39a382012 Add travis-ci repository to Cargo.toml 2017-02-06 19:24:35 -08:00
Tim Kuehn
efcc914e65 Add categories to Cargo.toml.
Also remove a keyword because 5's the limit.
2017-02-06 19:24:34 -08:00
compressed
a1072c8c06 Upgrade serde to 0.9 (#94)
* feat(serde): upgrade serde to 0.9

If you are using `#[derive(Serialize, Deserialize)]` or implementing
your own (de)serialization behavior for your RPC types you will need to
ensure you are using serde 0.9.x.

[breaking-change]

* chore(byteorder): upgrade byteorder to 1.0
2017-02-02 13:36:19 -08:00
Tim Kuehn
ed90f4ecea Merge master into sync-reactor 2017-02-01 22:48:49 -08:00
Tim Kuehn
b5bf696017 Merge master into sync-reactor 2017-02-01 22:39:19 -08:00
Tim Kuehn
fe20c8af14 Add a reactor::Core field to SyncClient.
This allows the client to drive its own execution, as one would expect.
Previously, the reactor had to be driven on a separate thread, which was confusing.
This has a couple notable side effects:
  1. SyncClient is no longer `Clone`.  This is because `reactor::Core`
     is not `Clone`, and creating one is not infallible
     (`Core::new` returns a `Result`).
  2. SyncClient does not use the user-specified `client::Options::handle` or
     `client::Options::remote`, because it constructs its own reactor.
2017-02-01 22:32:25 -08:00
Adam Wright
2ffa1138dd Merge pull request #91 from tikue/master
Temporary workaround for compiler bugs in impl Trait feature.
2017-02-01 21:05:33 -08:00
Tim Kuehn
9d552e48a4 Temporary workaround for compiler bugs in impl Trait feature. 2017-02-01 15:52:30 -08:00
compressed
fafe569ebc Add TLS support (#81)
When `-- features tls` is specified for tarpc, RPC communication can
also occur over a `TlsStream<TcpStream>` instead of a `TcpStream`.

* The functional tests have been refactored to use a common set of
functions for constructing the client and server structs so that all
the tests are shared across non-tls and tls test runs.

* Update pre-push to test TLS

* The `cfg_attr` logic caused many false warnings from clippy, so for now the crate docs for TLS are not tested.
2017-01-31 10:21:13 -08:00
Adam Wright
c286c596bd Merge pull request #85 from tikue/master
Make port reusable
2017-01-30 22:46:29 -08:00
Tim Kuehn
348111a423 Add test for reusing addr:port 2017-01-30 17:11:31 -08:00
Tim Kuehn
984c1c29c5 Make port reusable 2017-01-30 15:51:22 -08:00
Adam Wright
cc1290636d Merge pull request #82 from tikue/master
Make sure synchronous RPCs are wrapped in a lazy future.
2017-01-23 00:48:10 -08:00
Tim Kuehn
41683eee1d Change variable obfuscation style from prefix underscores to suffix underscores. 2017-01-22 22:41:06 -08:00
Tim Kuehn
6c2239d6f2 Cargo clippy 2017-01-22 21:16:11 -08:00
Tim Kuehn
3196fd91ff Cargo fmt 2017-01-22 20:08:38 -08:00
Tim Kuehn
45fa4c7bf1 Make sure synchronous RPCs are wrapped in a lazy future.
Some future-returning fns implicitly require the presence of an execution task. Wrapping in a lazy future ensures that by the time the future is polled, there is a task present.
2017-01-22 19:39:19 -08:00
Adam Wright
c7c18cbaaa Merge pull request #78 from tikue/master
Simplify Never impls: return the inner uninhabited type for fns taking &self.
2017-01-22 15:31:43 -08:00
Adam Wright
1c0cf2a67f Merge branch 'master' into master 2017-01-22 15:27:45 -08:00
Adam Wright
15a3900f3d Merge pull request #79 from tikue/private-items
Make private a couple items that no longer need to be public.
2017-01-22 15:23:59 -08:00
Adam Wright
f0ecd7008d Merge branch 'master' into private-items 2017-01-22 15:13:32 -08:00
Adam Wright
3567202aa3 Merge pull request #80 from tikue/client-reexports
Don't reexport client implementation details from crate root.
2017-01-22 15:13:22 -08:00
Tim Kuehn
802ee838ca Don't reexport client implementation details from crate root. 2017-01-17 16:38:30 -08:00
Tim Kuehn
c976ca710a Make private a couple items that no longer need to be public. 2017-01-17 15:36:08 -08:00
Tim Kuehn
9d2d69b4f4 Simplify Never impls: return the inner uninhabited type for fns taking &self. 2017-01-17 15:25:48 -08:00
Adam Wright
558dda28ad Merge pull request #75 from tikue/master
Add Options to all connect and listen fns
2017-01-15 17:21:30 -08:00