Commit Graph

36 Commits

Author SHA1 Message Date
Tim Kuehn
650dc88da5 Bump versions 2017-09-17 16:02:28 -07:00
Cyril Plisko
0676ab67df Refresh dependencies (#164) 2017-08-14 14:31:47 -07:00
Tim
21e8883877 Update to serde 1.0 and bincode 0.8 (#149) 2017-05-05 22:16:44 -07:00
Tim Kuehn
7dbfe07c97 Bump to version 0.7.3 and update release notes. 2017-04-26 12:33:58 -07:00
Tim Kuehn
9267daa409 Bump version 2017-04-22 16:28:27 -07:00
Tim
a441fcb771 Bump to 0.7.1 for some doc fixes (#141) 2017-03-31 15:18:35 -07:00
Tim
f0ad99b900 Prepare for Crates.io release (#140)
* Prepare tarpc-plugins for Crates.io release.

* Add a 0.7 bullet to RELEASES.md.

* Fix some outdated doc comments.

* Reexport ShutdownFuture.
2017-03-31 14:15:20 -07:00
Tim
5add81b5f3 Feature rollup (#129)
* Create a directory for the `future::server` module, which has become quite large. server.rs => server/mod.rs. Server submodules for shutdown and connection logic are added.

* Add fn thread_pool(...) to sync::server::Options

* Configure idle threads to expire after one minute

* Add tarpc::util::lazy for lazily executing functions. Similar to `futures::lazy` but useful in different circumstances. Specifically, `futures::lazy` typically requires a closure, whereas `util::lazy` kind of deconstructs a closure into its function and args.

* Remove some unstable features, and `cfg(plugin)` only in tests. Features `unboxed_closures` and `fn_traits` are removed by replacing manual Fn impls with Stream impls. This actually leads to slightly more performant code, as well, because some `Rc`s could be removed.

* Fix tokio deprecation warnings. Update to use tokio-io in lieu of deprecated tokio-core items. impl AsyncRead's optional `unsafe fn prepare_uninitialized_buffer` for huge perf wins

* Add debug impls to all public items and add `deny(missing_debug_implementations)` to the crate.

* Bump tokio core version.
2017-03-31 12:16:40 -07:00
Malte Schwarzkopf
f4018a431e bincode 1.0.0-alpha6 changed SizeLimit to a trait (#134)
Unfortunately, cargo's semantic versioning gets confused by the
"-alpha" suffix in current bincode versions (I think): even though
tarpc's Cargo.toml specified version "1.0.0-alpha4", cargo will
download the more recent "1.0.0-alpha6", which has breaking changes
to the `SizeLimit` enum.

This change makes tarpc work with bincode 1.0.0-alpha6 and updates the
dependency.
2017-03-19 11:12:17 -07:00
Tim
79aee18d17 Change module structure. (#122)
* Change `client::{future, sync}, server::{future, sync}` to `future::{client, server}, sync::{client, server}`

This reflects the most common usage pattern and allows for some types to not need to be fully qualified when used together (e.g. the previously-named `client::future::Options` and `server::future::Options` can now be `client::Options` and `server::Options`).

* sync::client: create a RequestHandler struct to encapsulate logic of processing client requests.

The largest benefit is that unit testing becomes easier, e.g. testing that the request processing stops when all request senders are dropped.

* Rename Serialize error variants to make sense.

* Rename tarpc_service_ConnectFuture__ => Connect (because it's public)

* Use tokio proto's ClientProxy.

Rather than reimplement the same logic. Curiously, this commit
isn't a net loss in LOC. Oh well.

* Factor out os-specific functionality in listener() into their own fns

* Remove service-fn dep
2017-03-07 18:20:46 -08:00
Cyril Plisko
8b9847e347 Update chrono (#111) 2017-02-20 13:05:47 -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
Adam Wright
0f52b08426 Merge branch 'master' into deps-cleanup 2017-02-15 20:49:53 -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
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
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
compressed
3dc1b6381d fix(futures): Either was only added in 0.1.7 (#76) 2017-01-13 15:21:07 -08:00
Tim Kuehn
e4ef0881e6 Update Cargo.toml to use crates.io releases of tokio deps. 2017-01-11 14:23:52 -08:00
Tim Kuehn
626254e836 Update tokio-core replacement to 0.1.3 2017-01-08 17:49:41 -08:00
Tim Kuehn
d242bdbb82 Track latest tokio changes 2016-12-26 00:27:42 -05:00
Tim Kuehn
13e56481bb Track latest changes to tokio-proto. 2016-12-04 20:26:32 -08:00
Tim Kuehn
3afcfe6274 Track latest git deps and rust compiler 2016-11-05 15:06:39 -07:00
Tim Kuehn
3506397150 Track latest tokio changes. 2016-10-28 11:33:20 -07:00
Tim Kuehn
8c0181633d Track crates.io deps 2016-09-14 10:11:28 -07:00
Tim Kuehn
1c318182c4 Don't serialize on a thread pool 2016-09-14 01:54:03 -07:00
Tim
be5f55c5f6 Extend snake_to_camel plugin to replace {} in the doc string with the original snake-cased ident. (#50)
* Extend snake_to_camel plugin to replace {} in the doc string with the origin snake-cased ident.

Also, track tokio-rs master.

This is really ad-hoc, undiscoverable, and unintuitive, but there's no way to programmatically create doc strings
in regular code, and I want to produce better doc strings for the associated types.

Given `fn foo_bar`:

Before: `/// The type of future returned by the function of the same name.`
After: ``/// The type of future returned by `{}`.``
    => `/// The type of future returned by foo_bar.`

* Fix some docs

* Use a helper fn on pipeline::Frame instead of handrolled match.

* Don't hide docs for ClientFuture.

It's exposed in the Connect impl of FutureService -- the tradeoff for not generating *another* item -- and hiding it breaks doc links.

* Formatting

* Rename snake_to_camel plugin => tarpc-plugins

* Update README

* Mangle a lot of names in macro expansion.

To lower the chance of any issues, prefix idents in service expansion with __tarpc_service.
In future_enum, prefix with __future_enum. The pattern is basically __macro_name_ident.

Any imported enum variant will conflict with a let binding or a function arg, so we basically
can't use any generic idents at all. Example:

    enum Req { request(..) }
    use self::Req::request;

    fn make_request(request: Request) { ... }

                    ^^^^^^^ conflict here

Additionally, suffix generated associated types with Fut to avoid conflicts with camelcased rpcs.
Why someone would do that, I don't know, but we shouldn't allow that wart.
2016-09-14 01:19:24 -07:00
Tim Kuehn
b5e472b374 Use the new serde_derive crate. 2016-09-06 16:11:32 -07:00
Tim
7aabfb3c14 Rewrite using tokio (#44)
* Rewrite tarpc on top of tokio.

* Add examples

* Move error types to their own module.

Also, cull unused error variants.

* Remove unused fn

* Remove CanonicalRpcError* types. They're 100% useless.

* Track tokio master (WIP)

* The great error revamp.

Removed the canonical rpc error type. Instead, the user declares
the error type for each rpc:

In the above example, the error type is Baz. Declaring an error is
optional; if none is specified, it defaults to Never, a convenience
struct that wraps the never type (exclamation mark) to impl Serialize, Deserialize,
Error, etc. Also adds the convenience type StringError for easily
using a String as an error type.

* Add missing license header

* Minor cleanup

* Rename StringError => Message

* Create a sync::Connect trait.

Along with this, the existing Connect trait moves to future::Connect. The future
and sync modules are reexported from the crate root.

Additionally, the utility errors Never and Message are no longer reexported from
the crate root.

* Update readme

* Track tokio/futures master. Add a Spawn utility trait to replace the removed forget.

* Fix pre-push hook

* Add doc comment to SyncServiceExt.

* Fix up some documentation

* Track tokio-proto master

* Don't set tcp nodelay

* Make future::Connect take an associated type for the future.

* Unbox FutureClient::connect return type

* Use type alias instead of newtype struct for ClientFuture

* Fix benches/latency.rs

* Write a plugin to convert lower_snake_case idents/types to UpperCamelCase.

Use it to add associated types to FutureService instead of boxing the return futures.

* Specify plugin = true in snake_to_camel/Cargo.toml. Weird things happen otherwise.

* Add clippy.toml
2016-09-04 16:09:50 -07:00
Tim Kuehn
6141b295d1 Add a tarpc_examples package 2016-01-11 23:39:58 -08:00
Tim Kuehn
98a34e4256 printlns => logging 2016-01-09 12:45:16 -08:00
Tim Kuehn
736cf5d463 Add my name 2016-01-09 01:26:18 -08:00
Adam Wright
4b0180d17f Initial commit 2016-01-06 21:01:11 -08:00