Commit Graph

57 Commits

Author SHA1 Message Date
Sam Reis
27b8db3af8 feat(lib): convert to use tokio 0.1
BREAKING CHANGE: All uses of `Handle` now need to be new-tokio `Handle`.

Co-authored-by: Sean McArthur <sean@seanmonstar.com>
2018-03-19 11:43:47 -07:00
Sean McArthur
3cd48b45fb feat(lib): replace types with those from http crate
BREAKING CHANGE: `Method`, `Request`, `Response`, `StatusCode`,
  `Version`, and `Uri` have been replaced with types from the `http`
  crate. The `hyper::header` module is gone for now.

  Removed `Client::get`, since it needed to construct a `Request<B>`
  with an empty body. Just use `Client::request` instead.

  Removed `compat` cargo feature, and `compat` related API.
2018-03-19 11:43:47 -07:00
Sean McArthur
dcfebc6308 chore(dependencies): update minimum Rust version to 1.21, because of tokio-core 2018-03-12 14:31:05 -07:00
Sean McArthur
b79f8d32b5 chore(ci): don't build docs on rust 1.18 2018-02-21 13:45:54 -08:00
Sean McArthur
5ce269ae7d chore(ci): update CI minimum Rust to 1.18 (because mio) 2018-01-09 15:53:06 -08:00
Sean McArthur
f7aeb1cab0 chore(ci): only build on Rust 1.17, don't run tests 2018-01-04 15:34:25 -08:00
Sean McArthur
6ade21aa7f feat(server): change default dispatcher
- Deprecates the `no_proto` configuration on `Server`. It is always
  enabled.
- Deprecates all pieces related to tokio-proto.
- Makes the tokio-proto crate optional, and the `server-proto` feature
  can be used to completely remove the dependency. It is enabled by
  default.
2017-12-28 19:15:57 -08:00
Sean McArthur
a453ea1064 test(lib): run coverage on integration tests 2017-11-14 15:40:13 -08:00
Sean McArthur
f7532b71d1 feat(lib): add support to disable tokio-proto internals
For now, this adds `client::Config::no_proto`, `server::Http::no_proto`,
and `server::Server::no_proto` to skip tokio-proto implementations, and
use an internal dispatch system instead.

`Http::no_proto` is similar to `Http::bind_connection`, but returns a
`Connection` that is a `Future` to drive HTTP with the provided service.
Any errors prior to parsing a request, and after delivering a response
(but before flush the response body) will be returned from this future.

See #1342 for more.
2017-10-27 00:02:07 -07:00
Sean McArthur
8ac1179d7c chore(ci): update minimum rustc version to 1.17 2017-10-09 09:40:53 -07:00
Sam Rijs
0c7d375ba3 feat(lib): implement compatibility with http crate 2017-09-22 12:07:57 -07:00
Sean McArthur
9036df2f4c chore(ci): update minimum rust version to 1.15 2017-06-03 14:42:42 -07:00
Mikhail Pak
a3c0e22a59 chore(travis): fix Travis coverage testing
* Move to the Trusty distro, since Precise is nearing end of life this year
  (https://blog.travis-ci.com/2017-04-17-precise-EOL)
* Add a --verify flag to avoid kcov segfaults.
  This was the reason why a 0% coverage was reported
* Link dead code to get more pessimistic results
2017-04-29 14:39:27 +02:00
Sean McArthur
736a342ea1 chore(travis): stop testing in non-existant doc directory 2017-04-17 10:42:22 -07:00
Sean McArthur
724d5e8669 chore(doc): remove unused doc folder 2017-04-17 10:29:28 -07:00
Sean McArthur
f05a58a1b2 chore(travis): set minimum rust version 2017-04-10 15:09:54 -07:00
Sean McArthur
c51a9993fa chore(travis): enable email notifications for broken builds 2017-03-02 15:33:42 -08:00
Sean McArthur
81f64b4af5 chore(travis): remove extra echos from travis.yml 2017-01-19 19:39:31 -08:00
Sean McArthur
c4572121fa chore(travis): update travis gh-pages token 2017-01-19 18:23:19 -08:00
Sean McArthur
b57a7a3df2 chore(travis): fix deploying docs after successful travis on master 2017-01-19 17:35:41 -08:00
Sean McArthur
e4232dd0d8 test(client): sleep disconnect test to reduce flakiness
Closes #1003
2017-01-16 12:58:06 -08:00
Sean McArthur
fef401921c chore(travis): only test integration benches, not run full benchmarks 2017-01-16 12:46:19 -08:00
Sean McArthur
be461b4663 perf(http): introduce MemBuf, a shared read buffer 2017-01-16 10:50:35 -08:00
Sean McArthur
2d2d5574a6 feat(lib): redesign API to use Futures and Tokio
There are many changes involved with this, but let's just talk about
user-facing changes.

- Creating a `Client` and `Server` now needs a Tokio `Core` event loop
to attach to.
- `Request` and `Response` both no longer implement the
`std::io::{Read,Write}` traits, but instead represent their bodies as a
`futures::Stream` of items, where each item is a `Chunk`.
- The `Client.request` method now takes a `Request`, instead of being
used as a builder, and returns a `Future` that resolves to `Response`.
- The `Handler` trait for servers is no more, and instead the Tokio
`Service` trait is used. This allows interoperability with generic
middleware.

BREAKING CHANGE: A big sweeping set of breaking changes.
2017-01-16 10:44:27 -08:00
Sean McArthur
0b02e61791 chore(travis): pipe git commands to dev null 2016-11-19 14:56:35 -08:00
Ahmed Charles
8b3c120684 feat(server): add path() and query() to Request
Closes #896 
Closes #897

BREAKING CHANGE: `RequestUri::AbsolutePath` variant is changed to a struct variant. Consider using `req.path()` or `req.query()` to get the relevant slice.
2016-08-29 13:45:38 -07:00
Sean McArthur
12c69b5dd0 docs(guide): add meat to the Server Guide
Closes #806
2016-07-25 20:23:44 -07:00
Sean McArthur
29b65f6bdd docs(guide): build and test markdown files in doc directory 2016-07-14 19:25:49 -07:00
Sean McArthur
e600cd89cb docs(lib): fix syntax error docs generation command 2016-06-20 16:05:12 -07:00
Sean McArthur
c94681fd76 docs(lib): only generate docs if on master branch or a tag commit 2016-06-20 14:03:50 -07:00
Sean McArthur
d35992d019 feat(lib): switch to non-blocking (asynchronous) IO
BREAKING CHANGE: This breaks a lot of the Client and Server APIs.
  Check the documentation for how Handlers can be used for asynchronous
  events.
2016-05-16 09:51:18 -07:00
Sean McArthur
4bdf52a482 Merge pull request #764 from hyperium/readme-tests
test(readme): test readme code fences
2016-04-19 17:25:03 -07:00
Sean McArthur
b98662ab6d test(readme): test readme code fences 2016-04-19 15:58:50 -07:00
Corey Farwell
e8826917d1 chore(travis): Enable Travis CI testing on OSX.
In preparation for https://github.com/hyperium/hyper/issues/755.
2016-04-16 21:02:04 -04:00
Corey Farwell
c53b5b242d chore(travis): Remove now default 'sudo: false'.
'sudo: false' is now default on Travis CI.
2016-04-16 16:59:27 -04:00
Sean McArthur
905e0d2ff4 chore(docs): publish docs per version 2016-03-24 18:57:23 -07:00
Huon Wilson
d2e9c94cf5 chore(nightly): remove ()'s and fix benchmarks for nightly
Also ensure that `cargo bench` runs successfully on travis; the old
`cargo bench ... || :` has the effect of ignoring any errors in it.
2015-10-14 15:04:15 +11:00
Sebastian Thiel
eb38a11b9a fix(benches): adjust to missing set_ssl_verifier
In 53bba6e , ssl usage was improved. The existing benchmark
implementation wasn't adjusted though.

This commit fixes the client benchmark to work with the latest nightly
rust and instructs travis to try compile the benchmarks
when rustc nightly is used. This should prevent such kind of breakage
in future.
2015-06-26 14:06:47 +02:00
Sean McArthur
53bba6eb7f feat(ssl): redesign SSL usage
BREAKING CHANGE: Server::https was changed to allow any implementation
  of Ssl. Server in general was also changed. HttpConnector no longer
  uses SSL; using HttpsConnector instead.
2015-06-20 14:58:58 -07:00
Sean McArthur
07c6bc7731 chore(travis): remove sudo need from kcov 2015-06-08 19:14:10 -07:00
Sean McArthur
b29d96bc2b chore(travis): don't build docs with deps, or run full benchmarks 2015-06-01 10:23:29 -07:00
Sean McArthur
e9dcf45df3 chore(travis): add build config for 'stable' tests 2015-05-15 21:46:09 -07:00
Pyfisch
f270b1d79a chore(travis): Enable test coverage generation
Generates a test coverage using kcov on travis. The coverage is only
generated for beta builds. kcov requires using sudo, so beta builds
can't run on container infrastructure anymore.

Closes #44
2015-05-01 12:01:22 +02:00
Sean McArthur
f01cecbc06 chore(travis): add beta testing to travis-ci 2015-04-28 10:35:53 -07:00
Sean McArthur
29c8dd1b20 chore(travis): turn on email notifications 2015-04-27 18:56:13 -07:00
Sean McArthur
f246c6a4a8 chore(travis): use local ghp-import 2015-04-15 15:56:35 -07:00
Sean McArthur
4ed2ef5845 chore(travis): pip install --user ghp-import 2015-04-15 15:31:10 -07:00
Sean McArthur
7875bc9194 chore(travis): include nightly feature when building docs 2015-04-15 13:40:07 -07:00
Sean McArthur
cc7d9fa8c4 chore(travis): remove sudo from publish docs 2015-04-15 13:25:52 -07:00
Jonathan Reem
e864956734 fix(server): Use thread::spawn instead of thread::scoped. 2015-04-15 13:15:05 -07:00