Commit Graph

405 Commits

Author SHA1 Message Date
Tim Kuehn
db665ebb60 Bump itertools from 0.4 => 0.5 2016-10-27 19:07:54 -07:00
Tim Kuehn
cff8782e18 Replace try! with ? 2016-10-16 13:49:53 -07:00
Tim Kuehn
531dc20d66 Track nightly 2016-10-16 13:19:35 -07:00
Adam Wright
d8d240ec12 Add docs to play nicer with deny(misisng_docs) (#6) 2016-10-10 12:25:28 -04: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
b661ff0175 Complete ClientFuture on error. 2016-09-30 15:36:55 -04:00
Tim Kuehn
b880d65f44 Merge branch 'framed' of github.com:tikue/tarpc into framed 2016-09-30 15:19:16 -04:00
Tim Kuehn
451b99b92a Remove all remaining #[inline]s. 2016-09-30 15:16:29 -04:00
Tim Kuehn
99b13ae6fc Remove an unnecessary Box 2016-09-28 00:04:58 -07: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
3eb57d4009 Move the static remote to the default reactor core to the crate root.
It didn't really make sense in the framed module, which doesn't care about such things.
2016-09-17 18:31:08 -07:00
Tim Kuehn
14c97b61f9 Rename things to align with tokio changes. 2016-09-17 18:23:35 -07:00
Tim Kuehn
20d1a019ae WIP multiplex Parse/Serialize/FramedIo impls 2016-09-17 12:50:48 -07:00
Tim Kuehn
8c0181633d Track crates.io deps 2016-09-14 10:11:28 -07:00
Tim Kuehn
987e445935 Update benches 2016-09-14 01:57:03 -07:00
Tim Kuehn
1c318182c4 Don't serialize on a thread pool 2016-09-14 01:54:03 -07:00
Tim Kuehn
ac7e2eedb2 Update readme 2016-09-14 01:47:21 -07:00
Tim Kuehn
6d1fbab73c Fix readme 2016-09-14 01:36:57 -07:00
Tim
e8902c21a2 Mangle a lot of names in macro expansion. (#53)
* 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.

* Trim long macro lines
2016-09-14 01:34:35 -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
54017839d1 Remove an unused trait and a few unnecessary Send bounds (#54) 2016-09-13 21:35:05 -07:00
Adam Wright
b5f2fe5f4f Merge pull request #51 from tikue/client-side-request
Use cleverness to declare the client-side request enum inside a fn.
2016-09-13 18:02:04 -07:00
Adam Wright
437997b2d1 Merge pull request #52 from tikue/serde_derive
Use the new serde_derive crate.
2016-09-13 18:00:45 -07:00
Tim Kuehn
b5e472b374 Use the new serde_derive crate. 2016-09-06 16:11:32 -07:00
Tim Kuehn
f76030ecd7 Correct typos 2016-09-06 14:05:32 -07:00
Tim Kuehn
b7952d3f47 Fix README Cargo.toml 2016-09-06 14:00:57 -07:00
Tim Kuehn
8d561d21b2 Use cleverness to declare the client-side request enum inside a fn.
Previously, the enum couldn't be declared in the fn it was used in, because
they were part of the same repeating pattern in the macro syntax, and you can't
nest the same repeating pattern. I fixed this by expanding it early,
as a macro argument separate from the repeating fn pattern.
2016-09-06 03:54:02 -07:00
Adam Wright
8968b1fbd2 Merge pull request #49 from tikue/master
Remove two unused error variants of tarpc::Error.
2016-09-04 19:15:06 -07:00
Tim
ab6e829ddd Remove two unused errors. 2016-09-04 19:03:52 -07:00
Tim
246c09c876 Remove outdated potential improvement 2016-09-04 16:34:01 -07:00
Tim
e7cfbc1085 Update readme 2016-09-04 16:14:59 -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
Morton Fox
64ca851209 Fix the license link in the top strip (#48) 2016-08-26 21:42:40 -07:00
Dustin H
1738864d32 make documentation link go to latest version (#47) 2016-08-26 16:48:42 -07:00
Tim
683617674c Point documentation to docs.rs 2016-08-26 16:43:51 -07:00
Adam Wright
3c4932f55a Add gitter badge 2016-08-24 12:37:32 -07:00
Tim Kuehn
3cf8e440f7 Bump minor version. v0.6.0 2016-08-07 13:02:04 -07:00
Tim Kuehn
2e02f33fc4 Merge branch 'master' of github.com:google/tarpc v0.5.1 2016-07-28 20:49:12 -07:00
Tim Kuehn
d8472dcd1c Update README to reflect latest version. 2016-07-28 20:48:07 -07:00
Tim
2c5846621f Update dependency versions (#43)
* Update dependency versions

* Bump minor version.
2016-07-28 20:46:30 -07:00
Tim Kuehn
6a6157948a Bump minor version. 2016-07-28 20:37:51 -07:00
Tim Kuehn
1c18a3c4fe Update dependency versions 2016-07-28 20:25:46 -07:00
shaladdle
e8ec295e85 Merge pull request #35 from tikue/missing-debug
Add missing Debug impls.
2016-04-24 21:19:42 -07:00
Tim Kuehn
44eec09418 Add missing Debug impls. 2016-04-24 21:06:42 -07:00
shaladdle
fe116a1b6b Merge pull request #34 from tikue/macro-cleanup
Minor macro implementation cleanup.
2016-04-24 20:36:08 -07:00
Tim Kuehn
ec4fa8636b Minor macro implementation cleanup.
* Fold service into service_inner.
* Rename service_inner => service.
2016-04-24 20:02:46 -07:00
shaladdle
2d58340d16 Merge pull request #33 from tikue/bump-version
Bump version to v0.5.0
2016-04-24 19:37:04 -07:00
Tim Kuehn
801f09e9e6 Bump version to v0.5.0 v0.5.0 2016-04-24 19:18:42 -07:00
shaladdle
6ce3a3d943 Merge pull request #27 from tikue/listener
[Breaking] Add support for arbitrary transports.
2016-04-24 18:39:27 -07:00