Commit Graph

28 Commits

Author SHA1 Message Date
Tim Kuehn
05c6be192d Rework the future Connect trait to only have one method, which takes an Options arg. 2017-01-11 22:55:04 -08:00
Tim Kuehn
918b6b3b75 Make spawn_core private 2017-01-11 20:44:59 -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
b3c187cdac Remove commented out code 2017-01-08 22:14:26 -08:00
Tim Kuehn
ffea090726 Make SyncClient only require &self for RPCs. 2017-01-08 22:13:49 -08:00
Tim Kuehn
388c4be69a Fully commit to futures in hello world. 2016-12-29 12:08:31 +01:00
Tim Kuehn
5dbfa99d0b Shuffle around the sync/future modules 2016-12-26 16:02:44 -05:00
Tim Kuehn
d242bdbb82 Track latest tokio changes 2016-12-26 00:27:42 -05:00
Tim Kuehn
be156f4d6b Cut down size of readme_expanded. 2016-12-11 23:32:44 -08:00
Tim Kuehn
8a29aa29b2 Add an version of the readme where all macros are expanded (with slight modifications to make it prettier). 2016-12-09 22:26:04 -08:00
Tim Kuehn
b5750365ca Change readme example to exhibit deadlock... 2016-12-06 15:15:42 -08:00
Tim Kuehn
f6b1660092 Count requests in concurrency example 2016-12-05 16:06:58 -08:00
Tim Kuehn
13e56481bb Track latest changes to tokio-proto. 2016-12-04 20:26:32 -08:00
Tim Kuehn
608be5372b Try to fix concurrency example 2016-11-05 19:31:45 -07:00
Tim Kuehn
c437d66603 Fixes to readme 2016-11-05 16:47:46 -07:00
Tim Kuehn
68ba7505ac Update naming of publisher client and server in pubsub example 2016-11-05 15:22:17 -07:00
Tim Kuehn
85fbe411e6 Run clients in parallel (that's the whole point!). 2016-10-29 10:16:21 -07:00
Tim Kuehn
61e7d9aab8 Remove some logging and thread yielding. 2016-10-29 02:03:35 -07:00
Tim Kuehn
59988c6ee1 Initialize env_logger in example server_calling_server. 2016-10-29 02:02:33 -07:00
Tim Kuehn
a1de4c1b05 Re-work concurrency example to not use wait() everywhere. 2016-10-29 02:02:11 -07:00
Tim Kuehn
531dc20d66 Track nightly 2016-10-16 13:19:35 -07:00
Adam Wright
eb49c30fdb Add an example to the readme for futures (#4)
And add the example under examples/ so we know when it breaks.
2016-10-04 16:25:57 -04:00
Tim Kuehn
5bace01f2b Finish the multiplex implementation 2016-09-26 23:44:22 -07:00
Tim Kuehn
4a63064cbd Remove some panics, and don't use ToSocketAddrs in async methods. 2016-09-19 00:16:47 -07:00
Tim Kuehn
20d1a019ae WIP multiplex Parse/Serialize/FramedIo impls 2016-09-17 12:50:48 -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