commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
67961f8a36750e2c22f103aa0276f7271c67253d
Nikolay Kim
2018-10-29T22:48:56
rename timer to time
diff --git a/examples/basic.rs b/examples/basic.rs index 8162fcc..f31b6d7 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -80,7 +80,8 @@ fn main() { future::ok(()) }) }, - ).unwrap() + ) + .unwrap() .start(); sys.run(); di...
8
43
40
3d51aa71158a6912d8d6e2f451155d1dac7fdee8
Nikolay Kim
2018-10-29T22:40:10
no need for mut self for now method
diff --git a/src/keepalive.rs b/src/keepalive.rs index fc330f1..b79c6f8 100644 --- a/src/keepalive.rs +++ b/src/keepalive.rs @@ -77,7 +77,7 @@ impl<R, E, F> KeepAliveService<R, E, F> where F: Fn() -> E, { - pub fn new(ka: Duration, mut timer: LowResTimerService, f: F) -> Self { + pub fn new(ka: Duration, t...
2
2
2
a8a831a098bef0f277bff1d26424da72b91e3d25
Nikolay Kim
2018-10-29T21:04:53
add Display impl for Connect
diff --git a/src/connector.rs b/src/connector.rs index e8fbcfd..465dd6e 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -1,7 +1,7 @@ use std::collections::VecDeque; -use std::io; use std::net::SocketAddr; use std::time::Duration; +use std::{fmt, io}; use futures::{ future::{ok, FutureResult}, @@ -87,...
1
7
1
4b16af29c707ace9fa0d38050fbe4e7e438dee42
Nikolay Kim
2018-10-29T20:41:54
add Connect::parse() method
diff --git a/src/connector.rs b/src/connector.rs index 00a88c5..e8fbcfd 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -56,6 +56,22 @@ impl Connect { } } + /// split the string by ':' and convert the second part to u16 + pub fn parse<T: AsRef<str>>(host: T) -> Option<Connect> { + l...
1
16
0
c15e4b92a86f55fc3d8121590d5e318d6801eebf
Nikolay Kim
2018-10-29T20:27:00
add Hash impl
diff --git a/src/connector.rs b/src/connector.rs index 9657085..00a88c5 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -40,7 +40,7 @@ impl From<ResolverError> for ConnectorError { } } -#[derive(Eq, PartialEq, Debug)] +#[derive(Eq, PartialEq, Debug, Hash)] pub struct Connect { pub host: String, ...
1
1
1
e1418018c6488eb4c09ec2e2b8a95cf42458ea19
Nikolay Kim
2018-10-24T17:43:30
add BytesCodec
diff --git a/src/codec/bcodec.rs b/src/codec/bcodec.rs new file mode 100644 index 0000000..d7523bf --- /dev/null +++ b/src/codec/bcodec.rs @@ -0,0 +1,33 @@ +use std::io; + +use bytes::{Bytes, BytesMut}; +use tokio_codec::{Decoder, Encoder}; + +/// Bytes codec. +/// +/// Reads/Writes chunks of bytes from a stream. +#[de...
2
35
0
ff914f79fcb3b60f312b00cdf18f225a3fe75db6
Nikolay Kim
2018-10-24T05:40:56
make port required
diff --git a/src/connector.rs b/src/connector.rs index 638da31..9657085 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -43,23 +43,15 @@ impl From<ResolverError> for ConnectorError { #[derive(Eq, PartialEq, Debug)] pub struct Connect { pub host: String, - pub port: Option<u16>, + pub port: u16, ...
1
15
12
3a133e3974d642b7e22407090e4782d20ac4d7a5
Nikolay Kim
2018-10-24T05:26:16
restore DefaultConnector
diff --git a/src/connector.rs b/src/connector.rs index 62fbe1e..638da31 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -232,3 +232,49 @@ impl Future for TcpConnector { } } } + +#[derive(Clone)] +pub struct DefaultConnector(Connector); + +impl Default for DefaultConnector { + fn default() -> S...
1
46
0
0b0d14d1ea08b41d5b69913e2c987af3cb974d11
Nikolay Kim
2018-10-24T05:14:02
refactor Connector service
diff --git a/Cargo.toml b/Cargo.toml index c685c13..3f4a04a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-net" -version = "0.1.1" +version = "0.2.0" authors = ["Nikolay Kim <fafhrd91@gmail.com>"] description = "Actix net - framework for the compisible network services for Rust (ex...
3
105
148
099ebbfaa3e279cd304a740ec1b3a74f866554eb
Nikolay Kim
2018-10-24T04:38:36
add timeout service
diff --git a/src/lib.rs b/src/lib.rs index ab3f196..a50debd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,6 +69,7 @@ pub mod server; pub mod service; pub mod ssl; pub mod stream; +pub mod timeout; pub mod timer; #[derive(Copy, Clone, Debug)] diff --git a/src/timeout.rs b/src/timeout.rs new file mode 100644 ind...
2
163
0
afe15ba44f10e8d5a1e63da61d0d8ba81a6eac3b
Nikolay Kim
2018-10-20T15:34:16
use executor spawn
diff --git a/src/stream.rs b/src/stream.rs index 4b90ff1..bee5ec6 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; use futures::unsync::mpsc; use futures::{future, Async, Future, Poll, Stream}; -use tokio::executor::current_thread::spawn; +use tokio_current_thread::spawn;...
1
1
1
e32961a8976c794e6514ce9010e5b7c0268769a3
Nikolay Kim
2018-10-09T05:02:38
docs url
diff --git a/Cargo.toml b/Cargo.toml index 5f800ea..0c71e76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["network", "framework", "async", "futures"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-net.git" -documentation = "https://actix.rs/api/...
1
1
1
614d1696d85666b1a4f2504e6feb7facc61efd36
Nikolay Kim
2018-10-08T22:38:52
add Framed2
diff --git a/Cargo.toml b/Cargo.toml index 03d481e..3d8adff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["network", "framework", "async", "futures"] homepage = "https://actix.rs" repository = "https://github.com/actix/actix-net.git" -documentation = "https://actix.rs/api/...
4
323
23
29ae1600a3b1f0b7d13799537104861321378870
Nikolay Kim
2018-10-05T23:00:44
add TakeItem service
diff --git a/src/stream.rs b/src/stream.rs index 1f03cab..4b90ff1 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -1,8 +1,10 @@ +use std::marker::PhantomData; + use futures::unsync::mpsc; -use futures::{Async, Future, Poll, Stream}; +use futures::{future, Async, Future, Poll, Stream}; use tokio::executor::current_t...
1
66
2
d204c438a1de0dfe3fdba7375097865fc95f3ce6
Nikolay Kim
2018-10-05T22:37:15
add IntoFramed service
diff --git a/src/framed.rs b/src/framed.rs index 5f1904d..69cd6bd 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -412,3 +412,78 @@ where } } } + +pub struct IntoFramed<T, U, F> +where + T: AsyncRead + AsyncWrite, + F: Fn() -> U + Send + Clone + 'static, + U: Encoder + Decoder, +{ + factory...
1
75
0
b1899e2bb1dd53c57c071267d21fc14075f256b1
Nikolay Kim
2018-10-05T21:29:47
allow to change framed codec
diff --git a/src/codec/framed.rs b/src/codec/framed.rs index fac1aff..c73238b 100644 --- a/src/codec/framed.rs +++ b/src/codec/framed.rs @@ -120,6 +120,19 @@ impl<T, U> Framed<T, U> { self.inner.into_inner().into_inner().0 } + /// Consume the `Frame`, returning `Frame` with different codec. + pub ...
1
13
0
f8efabdce7070447d01dae1a09bb924dce8115bf
Nikolay Kim
2018-10-05T20:13:36
expose service and framed instances from framed transport
diff --git a/src/framed.rs b/src/framed.rs index 3b69e01..5f1904d 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -219,6 +219,29 @@ where flushed: true, } } + + /// Get reference to a service wrapped by `FramedTransport` instance. + pub fn get_ref(&self) -> &S { + &self.service...
1
23
0
7da916e382862e6de81ab7cf73038c08c522f778
Nikolay Kim
2018-10-05T20:07:09
add forked version of Framed type
diff --git a/src/codec/framed.rs b/src/codec/framed.rs new file mode 100644 index 0000000..fac1aff --- /dev/null +++ b/src/codec/framed.rs @@ -0,0 +1,278 @@ +#![allow(deprecated)] + +use std::fmt; +use std::io::{self, Read, Write}; + +use bytes::BytesMut; +use futures::{Poll, Sink, StartSend, Stream}; +use tokio_codec:...
6
775
1
2600179169a6f4e0f2175253e4b5a4f5d04b684a
Nikolay Kim
2018-10-03T17:34:14
remove constraint
diff --git a/src/ssl/openssl.rs b/src/ssl/openssl.rs index 52c6145..26a7001 100644 --- a/src/ssl/openssl.rs +++ b/src/ssl/openssl.rs @@ -18,7 +18,7 @@ pub struct OpensslAcceptor<T> { io: PhantomData<T>, } -impl<T: AsyncRead + AsyncWrite> OpensslAcceptor<T> { +impl<T> OpensslAcceptor<T> { /// Create default...
1
1
1
20b03a478063d6bb293a6636632f976113812e13
Nikolay Kim
2018-10-03T05:18:07
add custom cell
diff --git a/Cargo.toml b/Cargo.toml index a98b29e..03d481e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,8 @@ ssl = ["openssl", "tokio-openssl"] # rustls rust-tls = ["rustls", "tokio-rustls", "webpki", "webpki-roots"] +cell = [] + [dependencies] actix = "0.7.0" diff --git a/src/cell.rs b/src/cell.rs ne...
7
87
35
79b525bc2f15e63e6d0da4f7c0ea491e3fc76346
Nikolay Kim
2018-10-03T04:47:50
add .then() combinator
diff --git a/src/service/and_then.rs b/src/service/and_then.rs index f266563..187ab16 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -52,11 +52,8 @@ where type Future = AndThenFuture<A, B>; fn poll_ready(&mut self) -> Poll<(), Self::Error> { - match self.a.poll_ready() { - ...
3
368
6
028279713eea66b7550330807872498d70636986
Nikolay Kim
2018-10-03T04:31:11
simplify FnNewService
diff --git a/src/service/fn_service.rs b/src/service/fn_service.rs index 7a4e228..e81ca64 100644 --- a/src/service/fn_service.rs +++ b/src/service/fn_service.rs @@ -71,16 +71,16 @@ where } } -pub struct FnNewService<F, Req, Resp, Err, IErr, Fut> +pub struct FnNewService<F, Req, Resp, Err, Fut> where F: Fn...
1
8
9
70efa00646181734af0d7fb00de9961eaa4ec860
Nikolay Kim
2018-10-02T20:37:30
upgrade rustls
diff --git a/Cargo.toml b/Cargo.toml index e95ffa0..a98b29e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,8 +67,8 @@ openssl = { version="0.10", optional = true } tokio-openssl = { version="0.2", optional = true } #rustls -rustls = { version = "^0.13.1", optional = true } -tokio-rustls = { version = "^0.7.2", opt...
2
7
7
fc7c436387f0db8a32e85cda4e0b8c4268dd4ce7
Nikolay Kim
2018-09-28T19:22:49
drop server service errors
diff --git a/src/server/services.rs b/src/server/services.rs index 43ba8ce..3fa3e0c 100644 --- a/src/server/services.rs +++ b/src/server/services.rs @@ -21,18 +21,13 @@ pub enum ServerMessage { } pub trait StreamServiceFactory: Send + Clone + 'static { - type NewService: NewService<Request = TcpStream, Response ...
1
28
21
1745a575a5d319c13e355f458e11ab2898c23268
Nikolay Kim
2018-09-28T04:45:40
add constraints
diff --git a/src/ssl/openssl.rs b/src/ssl/openssl.rs index 26a7001..52c6145 100644 --- a/src/ssl/openssl.rs +++ b/src/ssl/openssl.rs @@ -18,7 +18,7 @@ pub struct OpensslAcceptor<T> { io: PhantomData<T>, } -impl<T> OpensslAcceptor<T> { +impl<T: AsyncRead + AsyncWrite> OpensslAcceptor<T> { /// Create default...
1
1
1
d19ed8b00ae709a463d07ee9dac4397c893000a3
Nikolay Kim
2018-09-28T00:05:48
add Either service
diff --git a/src/either.rs b/src/either.rs new file mode 100644 index 0000000..efc6b3d --- /dev/null +++ b/src/either.rs @@ -0,0 +1,103 @@ +//! Contains `Either` service and related types and functions. +use futures::{future, Async, Future, Poll}; + +use super::service::{NewService, Service}; + +/// Combine two differe...
3
119
0
ba57e67a741692f546c3e5a4dc0f854fe1aeec18
Nikolay Kim
2018-09-27T03:40:45
expose ServerMessage service
diff --git a/src/framed.rs b/src/framed.rs index a9551a0..8b81b0b 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -233,29 +233,18 @@ where fn poll_service(&mut self) -> bool { match self.service.poll_ready() { Ok(Async::Ready(_)) => { - let mut item = self.request.take(); + ...
5
206
103
13c66a2ac4280d34fe6150ddb688181cb319060f
Nikolay Kim
2018-09-25T05:31:05
better FramedTransportError
diff --git a/src/framed.rs b/src/framed.rs index 6f0877a..a9551a0 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -159,10 +159,16 @@ where } /// Framed transport errors -pub enum FramedTransportError<E1, E2, E3> { - Service(E1), - Encoder(E2), - Decoder(E3), +pub enum FramedTransportError<E, U: Encoder +...
1
13
7
d5d2c81c68cb6a968d3da0852000d24d95c59af2
Nikolay Kim
2018-09-25T04:03:05
simplify FramedTransport response
diff --git a/src/framed.rs b/src/framed.rs index a105327..6f0877a 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -3,7 +3,7 @@ use std::marker::PhantomData; use std::mem; use actix; -use futures::future::{ok, Either, FutureResult}; +use futures::future::{ok, FutureResult}; use futures::unsync::mpsc; use futures...
1
10
20
205079adce08d566c28fa139abebf9ac069c247b
Nikolay Kim
2018-09-25T03:51:53
simplify framed transport error
diff --git a/src/framed.rs b/src/framed.rs index 10ea0c3..a105327 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -159,10 +159,10 @@ where } /// Framed transport errors -pub enum FramedTransportError<S: Service, U: Encoder + Decoder> { - Decoder(<U as Decoder>::Error), - Encoder(<U as Encoder>::Error), - ...
1
7
7
d4b772d454e512d8591ce9f1822a552209577efb
Nikolay Kim
2018-09-25T03:40:31
simplify FramedTransport
diff --git a/src/framed.rs b/src/framed.rs index 11d4f2a..10ea0c3 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -1,9 +1,9 @@ //! Framed dispatcher service and related utilities -use std::fmt; use std::marker::PhantomData; +use std::mem; use actix; -use futures::future::{ok, Either, FutureResult, Join}; +use fu...
1
68
201
7686011c1a26ca64e8e1a2367fa3d14b3bbe86af
Nikolay Kim
2018-09-25T03:06:20
refactor FramedTransport, add separate service for error handling
diff --git a/src/framed.rs b/src/framed.rs index ddda25f..11d4f2a 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -3,7 +3,7 @@ use std::fmt; use std::marker::PhantomData; use actix; -use futures::future::{ok, Either, FutureResult}; +use futures::future::{ok, Either, FutureResult, Join}; use futures::unsync::mpsc...
1
306
92
01bed8b2e5d4e855c78d50c4baeb7cf4644223a9
Nikolay Kim
2018-09-25T00:50:29
rename FramedDispatcher to FramedTransport
diff --git a/src/framed.rs b/src/framed.rs index 93e462b..ddda25f 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -60,7 +60,7 @@ where <U as Encoder>::Error: fmt::Debug + 'static, { type Request = Framed<T, U>; - type Response = FramedDispatcher<S::Service, T, U>; + type Response = FramedTransport<S:...
1
9
9
477e1d69533a515419978377e48428779964c36f
Nikolay Kim
2018-09-20T18:16:12
add keep-alive service
diff --git a/src/keepalive.rs b/src/keepalive.rs new file mode 100644 index 0000000..fc330f1 --- /dev/null +++ b/src/keepalive.rs @@ -0,0 +1,123 @@ +use std::marker::PhantomData; +use std::time::{Duration, Instant}; + +use futures::future::{ok, FutureResult}; +use futures::{Async, Future, Poll}; +use tokio_timer::Delay...
3
165
31
ffe73c6875e7edb3638e028c05e9e06008ffbbae
Nikolay Kim
2018-09-19T22:05:14
add low res timer service
diff --git a/src/lib.rs b/src/lib.rs index d4c592e..ae6f3d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,3 +65,4 @@ pub mod server; pub mod service; pub mod ssl; pub mod stream; +pub mod lowrestimer; diff --git a/src/lowrestimer.rs b/src/lowrestimer.rs new file mode 100644 index 0000000..3208716 --- /dev/null +++...
2
99
0
601c8a4ee69e031832fb831e55377fa6b454b505
Nikolay Kim
2018-09-18T04:46:02
add CloneableService
diff --git a/src/cloneable.rs b/src/cloneable.rs new file mode 100644 index 0000000..d94e295 --- /dev/null +++ b/src/cloneable.rs @@ -0,0 +1,42 @@ +use std::cell::RefCell; +use std::rc::Rc; + +use futures::Poll; + +use super::service::Service; + +/// Service that allows to turn non-clone service to a service with `Clon...
2
43
0
4827990298e5c3d1162c44c38dbabf2fd47aa81b
Nikolay Kim
2018-09-18T02:21:24
add NewServiceExt tests
diff --git a/src/service/and_then.rs b/src/service/and_then.rs index db69df1..f266563 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -230,7 +230,7 @@ mod tests { use std::rc::Rc; use super::*; - use service::{Service, ServiceExt}; + use service::{NewServiceExt, Service, ServiceE...
5
67
5
90ad1b12a8a5826942b4dc13fe2a695e22d06bc8
Nikolay Kim
2018-09-18T01:49:55
do not constrain InitError for from_err new service
diff --git a/src/service/from_err.rs b/src/service/from_err.rs index d0e40c5..c4ee761 100644 --- a/src/service/from_err.rs +++ b/src/service/from_err.rs @@ -89,7 +89,7 @@ pub struct FromErrNewService<A, E> { impl<A, E> FromErrNewService<A, E> where A: NewService, - E: From<A::Error> + From<A::InitError>, + ...
2
8
8
e0f4aac3b4cfbdb814c5f68a1530d60bad12a991
Nikolay Kim
2018-09-18T01:10:23
add NewService::from_err combinator
diff --git a/src/service/from_err.rs b/src/service/from_err.rs index 671046d..d0e40c5 100644 --- a/src/service/from_err.rs +++ b/src/service/from_err.rs @@ -1,8 +1,8 @@ use std::marker::PhantomData; -use futures::{Future, Poll}; +use futures::{Async, Future, Poll}; -use super::Service; +use super::{NewService, Ser...
3
115
5
20cff6fc0b61f09432b576f8065985ccad1f853b
Nikolay Kim
2018-09-17T23:50:35
update apply tests
diff --git a/src/service/apply.rs b/src/service/apply.rs index 8a9ec1e..06da34c 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -173,7 +173,7 @@ mod tests { use futures::future::{ok, FutureResult}; use futures::{Async, Future, Poll}; - use service::{Service, ServiceExt}; + use service:...
1
7
3
a91b9a2f9e82374efb640a1c764125145ee41871
Nikolay Kim
2018-09-17T23:16:42
better ergonomics for aply combinator
diff --git a/src/service/apply.rs b/src/service/apply.rs index 7d1bbab..8a9ec1e 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -2,7 +2,7 @@ use std::marker::PhantomData; use futures::{Async, Future, IntoFuture, Poll}; -use super::{IntoNewService, NewService, Service}; +use super::{IntoNewService, ...
2
13
8
3384bbfae25be7379435acd05be90fca158722c7
Nikolay Kim
2018-09-17T22:53:41
change apply combinator
diff --git a/src/service/apply.rs b/src/service/apply.rs index 11fffce..7d1bbab 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -19,7 +19,7 @@ where R: IntoFuture, { /// Create new `Apply` combinator - pub fn new(f: F, service: T) -> Self { + pub fn new(service: T, f: F) -> Self { ...
2
18
13
39a18d69698a959e37183df1303219ba34cfee61
Nikolay Kim
2018-09-14T20:30:29
add in-flight service
diff --git a/src/inflight.rs b/src/inflight.rs new file mode 100644 index 0000000..6ee82a8 --- /dev/null +++ b/src/inflight.rs @@ -0,0 +1,128 @@ +use futures::{Async, Future, Poll}; + +use super::counter::{Counter, CounterGuard}; +use super::service::{IntoNewService, IntoService, NewService, Service}; + +/// InFlight -...
2
129
0
2927a49fdfe1c13505694bbba09fcfed63335257
Nikolay Kim
2018-09-14T20:12:55
better method names
diff --git a/src/counter.rs b/src/counter.rs index d2bd022..1302c91 100644 --- a/src/counter.rs +++ b/src/counter.rs @@ -11,15 +11,15 @@ pub struct Counter(Rc<CounterInner>); struct CounterInner { count: Cell<usize>, - max: usize, + capacity: usize, task: AtomicTask, } impl Counter { /// Cre...
3
13
11
39c39028180511a6a135023bf54d9e4bf5f64318
Nikolay Kim
2018-09-14T20:07:38
rename Connections to more generic Counter and export it
diff --git a/src/counter.rs b/src/counter.rs new file mode 100644 index 0000000..d2bd022 --- /dev/null +++ b/src/counter.rs @@ -0,0 +1,76 @@ +use std::cell::Cell; +use std::rc::Rc; + +use futures::task::AtomicTask; + +#[derive(Clone)] +/// Simple counter with ability to notify task on reaching specific number +/// +///...
6
93
88
9888c1c5e6d9338534a11b85ea34e8fcbceb92a1
Nikolay Kim
2018-09-14T07:07:50
fix switching to unavailable state for worker
diff --git a/src/server/worker.rs b/src/server/worker.rs index 7d5a1fc..eb8f7e4 100644 --- a/src/server/worker.rs +++ b/src/server/worker.rs @@ -210,6 +210,7 @@ impl Future for Worker { WorkerState::Unavailable(mut conns) => { match self.check_readiness() { Ok(true) =>...
1
31
22
ec7757f032a8971132239f2ac75b0f40b7be0415
Nikolay Kim
2018-09-14T06:46:01
refactor worker availibility management
diff --git a/Cargo.toml b/Cargo.toml index ad01691..484e117 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,6 @@ actix = "0.7.0" log = "0.4" num_cpus = "1.0" -failure = "^0.1.2" # io mio = "^0.6.13" diff --git a/src/lib.rs b/src/lib.rs index 324c308..ca4a657 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18...
5
243
167
2764323580ef296249b0b7ca131f60f9f4f68b38
Nikolay Kim
2018-09-13T20:32:51
fix service availability check
diff --git a/src/server/mod.rs b/src/server/mod.rs index fb65b43..b080ffe 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -37,5 +37,5 @@ impl Message for StopServer { } /// Socket id token -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub(crate) struct Token(usize); diff --git a/src/server/worke...
2
3
3
d50829d956414bd6635ca7ff813925ce990b69fc
Nikolay Kim
2018-09-13T01:47:39
add framed related services and utils
diff --git a/Cargo.toml b/Cargo.toml index c31c325..ad01691 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ bytes = "0.4" futures = "0.1" slab = "0.4" tokio = "0.1" +tokio-codec = "0.1" tokio-io = "0.1" tokio-tcp = "0.1" tokio-timer = "0.2" diff --git a/src/framed.rs b/src/framed.rs new file mode 10064...
3
307
0
62dbe1b001c6e768e20c3e1b8f2fdfab2b93d490
Nikolay Kim
2018-09-12T20:34:53
add some doc apis and tests
diff --git a/src/service/and_then.rs b/src/service/and_then.rs index 8315e52..db69df1 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -5,7 +5,10 @@ use futures::{Async, Future, Poll}; use super::{IntoNewService, NewService, Service}; -/// `AndThen` service combinator +/// Service for the `and...
6
299
29
f66eec00e764add185e1375eca204fe6044e5ccd
Nikolay Kim
2018-09-12T15:25:14
restart failed services; fix readiness check
diff --git a/src/server/worker.rs b/src/server/worker.rs index 889a2ac..33d3bc7 100644 --- a/src/server/worker.rs +++ b/src/server/worker.rs @@ -114,6 +114,7 @@ pub(crate) struct Worker { services: Vec<BoxedServerService>, availability: WorkerAvailability, conns: Connections, + factories: Vec<Box<Inte...
1
56
15
f0554efb98881e824731cbb9eba57de4ae90e932
Nikolay Kim
2018-09-11T18:28:13
remove wrong doc example
diff --git a/examples/basic.rs b/examples/basic.rs index 8a21348..ba073db 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -75,23 +75,20 @@ fn main() { // service for converting incoming TcpStream to a SslStream<TcpStream> (move |stream| { - SslAcceptorExt::ac...
3
14
38
b0d120c1016dab8f1ee99ad7ce067fc822ef77b4
Nikolay Kim
2018-09-11T17:55:49
update examples
diff --git a/examples/basic.rs b/examples/basic.rs index 5bbd529..8a21348 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -20,7 +20,8 @@ use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; use tokio_io::{AsyncRead, AsyncWrite}; use tokio_openssl::SslAcceptorExt; -use actix_net::{IntoNewService, NewSe...
2
5
2
82b71d91ea5d00fdee0431c2c8dc94e501d87920
Nikolay Kim
2018-09-11T16:30:22
move Service to service sub mod
diff --git a/src/connector.rs b/src/connector.rs index 66fc065..b2bf235 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -11,7 +11,7 @@ use trust_dns_resolver::config::{ResolverConfig, ResolverOpts}; use trust_dns_resolver::system_conf::read_system_conf; use super::resolver::{HostAware, Resolver, ResolverErr...
16
22
22
abef930f87358a8f1e810000669bfd8eb4a64278
Nikolay Kim
2018-09-11T15:59:03
fix openssl uses
diff --git a/src/server/mod.rs b/src/server/mod.rs index 981afec..44923cd 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -10,7 +10,7 @@ mod worker; pub use self::server::Server; pub use self::services::ServerServiceFactory; -pub(crate) use self::worker::Connections; +pub(crate) use self::worker::{Connect...
2
2
2
56b31960f1e665c9aee69288495f696a2c25379c
Nikolay Kim
2018-09-11T03:02:55
derive Debug for connector/resolver error
diff --git a/src/connector.rs b/src/connector.rs index c9ecdde..66fc065 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -14,7 +14,7 @@ use super::resolver::{HostAware, Resolver, ResolverError, ResolverFuture}; use super::{NewService, Service}; // #[derive(Fail, Debug)] - +#[derive(Debug)] pub enum Connecto...
2
2
1
d8ed9ae43a3f9b45bff95089cc67de318005f4f7
Nikolay Kim
2018-09-11T02:42:51
create Connector with custom Resolver
diff --git a/src/connector.rs b/src/connector.rs index 2da44f3..c9ecdde 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -63,6 +63,16 @@ impl<T: HostAware> Connector<T> { } } + pub fn with_resolver( + resolver: Resolver<T>, + ) -> impl Service< + Request = T, + Response...
1
10
0
88d8c99e317b7a0d8e9cf6f8bc11a0a8514a224c
Nikolay Kim
2018-09-11T02:39:55
use Resolver service for Connector
diff --git a/src/connector.rs b/src/connector.rs index fe2646a..2da44f3 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -1,54 +1,47 @@ use std::collections::VecDeque; use std::io; -use std::marker::PhantomData; use std::net::SocketAddr; use futures::{ future::{ok, FutureResult}, Async, Future, P...
3
55
144
2698534b057a01c2f778f41ce615594d6d094cd6
Nikolay Kim
2018-09-11T02:16:46
add resolver service
diff --git a/src/lib.rs b/src/lib.rs index f6a061a..2db03f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,6 +64,7 @@ pub use tower_service::{NewService, Service}; pub(crate) mod accept; pub mod connector; +pub mod resolver; pub mod server; mod server_service; pub mod service; diff --git a/src/resolver.rs b/src...
2
152
0
a1e875e985da17607977e51587a3641d18b4352e
Nikolay Kim
2018-09-10T18:16:58
add Clone impl for DefaultConnector
diff --git a/src/connector.rs b/src/connector.rs index d1006ac..fe2646a 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -150,6 +150,7 @@ impl<T: HostAware> Future for ConnectorFuture<T> { } } +#[derive(Clone)] pub struct DefaultConnector<T: HostAware>(Connector<T>); impl<T: HostAware> Default for De...
1
1
0
fbfca66e216e1500373b972e26c631f7277e058e
Nikolay Kim
2018-09-10T17:59:35
add DefaultConnector
diff --git a/src/connector.rs b/src/connector.rs index 6bf949c..d1006ac 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -150,6 +150,51 @@ impl<T: HostAware> Future for ConnectorFuture<T> { } } +pub struct DefaultConnector<T: HostAware>(Connector<T>); + +impl<T: HostAware> Default for DefaultConnector<T>...
2
46
0
3fe029a8ad6d94ea6c87320881d8b8431c35848e
Nikolay Kim
2018-09-10T17:01:58
remove unneeded code
diff --git a/src/configurable.rs b/src/configurable.rs deleted file mode 100644 index 1f67342..0000000 --- a/src/configurable.rs +++ /dev/null @@ -1,553 +0,0 @@ -use std::marker; - -use futures::{future, future::FutureResult, Async, Future, IntoFuture, Poll}; -use tower_service::Service; - -use service::{AndThen, FnSer...
2
0
555
552d19a0eb2e7f71460b2b89d0dd7dfd128f1d36
Nikolay Kim
2018-09-08T21:50:16
add generic server service factory
diff --git a/examples/basic.rs b/examples/basic.rs index 4e2039c..5bbd529 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -9,11 +9,11 @@ extern crate tokio_io; extern crate tokio_openssl; extern crate tokio_tcp; +use std::fmt; use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, }; -use std:...
5
50
50
4264574af11cae56496165e8dbd5440b37403571
Nikolay Kim
2018-09-08T19:58:08
fix openssl NewService definition
diff --git a/src/ssl/openssl.rs b/src/ssl/openssl.rs index f611e40..025d074 100644 --- a/src/ssl/openssl.rs +++ b/src/ssl/openssl.rs @@ -1,4 +1,3 @@ -use std::io; use std::marker::PhantomData; use futures::{future::ok, future::FutureResult, Async, Future, Poll}; @@ -44,7 +43,7 @@ impl<T: AsyncRead + AsyncWrite> New...
1
1
2
c2eff62efb71d2f2cd23eb502201dc73eda9af8b
Nikolay Kim
2018-09-08T19:52:43
openssl new service is not failable
diff --git a/src/ssl/openssl.rs b/src/ssl/openssl.rs index 2a0d80a..f611e40 100644 --- a/src/ssl/openssl.rs +++ b/src/ssl/openssl.rs @@ -43,7 +43,7 @@ impl<T: AsyncRead + AsyncWrite> NewService for OpensslAcceptor<T> { type Response = SslStream<T>; type Error = Error; type Service = OpensslAcceptorServic...
1
1
1
bf10f6dfcf98da4128186c4892240e86aae6a72f
Nikolay Kim
2018-09-08T17:16:43
simplify openssl acceptor
diff --git a/src/ssl/openssl.rs b/src/ssl/openssl.rs index 69690ee..2a0d80a 100644 --- a/src/ssl/openssl.rs +++ b/src/ssl/openssl.rs @@ -2,13 +2,13 @@ use std::io; use std::marker::PhantomData; use futures::{future::ok, future::FutureResult, Async, Future, Poll}; -use openssl::ssl::{AlpnError, Error, SslAcceptor, S...
1
10
30
8b13236d415617e360eed1d10296e8082519d901
Nikolay Kim
2018-09-08T16:36:38
refactor connections counter
diff --git a/Cargo.toml b/Cargo.toml index d5b06ff..c31c325 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,9 @@ tokio-io = "0.1" tokio-tcp = "0.1" tokio-timer = "0.2" tokio-reactor = "0.1" +tokio-current-thread = "0.1" tower-service = "0.1" + trust-dns-resolver = "0.10.0-alpha.2" # native-tls diff --git ...
6
130
129
5f016bd53cede966a8b22046d2643222d26e53ea
Nikolay Kim
2018-09-08T06:27:00
export server mod
diff --git a/src/lib.rs b/src/lib.rs index 9293b90..1cb81ed 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,7 @@ pub use tower_service::{NewService, Service}; pub(crate) mod accept; pub mod configurable; pub mod connector; -mod server; +pub mod server; mod server_service; pub mod service; pub mod ssl;
1
1
1
4e186cc6d2003467fbf638a2fad7452b0872d0dd
Nikolay Kim
2018-09-07T21:49:17
explicitly use unit for server service error
diff --git a/src/server.rs b/src/server.rs index 43e67a6..0e97745 100644 --- a/src/server.rs +++ b/src/server.rs @@ -147,7 +147,7 @@ impl Server { where F: Fn() -> N + Clone + Send + 'static, U: net::ToSocketAddrs, - N: NewService<Request = TcpStream, Response = (), InitError = ()> + 'stat...
2
5
5
0fdce013756df223bdf3ac36c7932a2d24a59399
Nikolay Kim
2018-09-07T21:34:31
remove Display from server service Error
diff --git a/src/configurable.rs b/src/configurable.rs index 614a491..1f67342 100644 --- a/src/configurable.rs +++ b/src/configurable.rs @@ -349,7 +349,7 @@ where self.a = Some(service); } - if let Async::Ready(service) = self.fut_b.poll().map_err(|e| e.into())? { + if let Async::R...
5
15
11
d4808acee1b3d39f4bfcdcf06518595ae66c0bfe
Nikolay Kim
2018-09-07T20:06:51
implement worker availability system
diff --git a/src/lib.rs b/src/lib.rs index 2f694c7..60533ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,6 +26,7 @@ extern crate tokio_timer; extern crate tower_service; extern crate trust_dns_resolver; +#[allow(unused_imports)] #[macro_use] extern crate actix; diff --git a/src/server.rs b/src/server.rs inde...
4
117
112
8298da0f4a2d456ef54a04ead8f041d96bf0818c
Nikolay Kim
2018-09-07T18:42:22
change InitError type
diff --git a/src/server.rs b/src/server.rs index a5e23d2..c61a3f5 100644 --- a/src/server.rs +++ b/src/server.rs @@ -151,7 +151,7 @@ impl Server { where F: Fn() -> N + Clone + Send + 'static, U: net::ToSocketAddrs, - N: NewService<Request = TcpStream, Response = (), InitError = io::Error> ...
2
5
6
db1fe14fd2c7e6876617e648f93e25f2adec2c2e
Nikolay Kim
2018-09-07T18:35:25
add service readiness to ServerService
diff --git a/src/server.rs b/src/server.rs index 2541b3a..a5e23d2 100644 --- a/src/server.rs +++ b/src/server.rs @@ -17,7 +17,7 @@ use actix::{ }; use super::accept::{AcceptLoop, AcceptNotify, Command}; -use super::server_service::{ServerNewService, ServerServiceFactory}; +use super::server_service::{self, ServerNe...
5
156
132
467350c9fcba2ca879f3a97c1778962dc58ef360
Nikolay Kim
2018-09-07T17:38:39
add readiness support for OpensslAcceptor
diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs index 5b90027..5504f15 100644 --- a/src/ssl/mod.rs +++ b/src/ssl/mod.rs @@ -1,9 +1,18 @@ //! SSL Services +use std::sync::atomic::{AtomicUsize, Ordering}; + #[cfg(feature = "ssl")] mod openssl; #[cfg(feature = "ssl")] pub use self::openssl::{OpensslAcceptor, OpensslConn...
2
94
6
d917b478686062e2415244481dfbe4f9a818fe0d
Nikolay Kim
2018-09-07T01:03:01
remove unneeded phantom data
diff --git a/src/service/apply.rs b/src/service/apply.rs index 0c29b81..d98e77c 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -7,7 +7,7 @@ use {IntoNewService, NewService, Service}; pub struct Apply<T, F, R, Req> { service: T, f: F, - r: PhantomData<Fn(Req) -> R>, + r: PhantomData<(Re...
3
11
41
0525da70bf0bd3dfaab8ee25258562ec2bc40913
Nikolay Kim
2018-09-06T02:27:52
add Clone impl for FromErr combinator
diff --git a/src/service/from_err.rs b/src/service/from_err.rs index 613d604..ef5619d 100644 --- a/src/service/from_err.rs +++ b/src/service/from_err.rs @@ -20,6 +20,19 @@ impl<A: Service, E: From<A::Error>> FromErr<A, E> { } } +impl<A, E> Clone for FromErr<A, E> +where + A: Service + Clone, + E: From<A::...
1
13
0
983223a83965559885a065adffee97bb6379aa0e
Nikolay Kim
2018-09-05T20:54:15
add clone impls for combinator services
diff --git a/src/service/and_then.rs b/src/service/and_then.rs index 5b0a65f..ef3a311 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -26,6 +26,19 @@ where } } +impl<A, B> Clone for AndThen<A, B> +where + A: Service + Clone, + B: Service<Request = A::Response, Error = A::Error>, +{ +...
5
75
2
8540d81dcfa7230f0ab280f7810d7ff5c9ecbd43
Nikolay Kim
2018-09-04T19:42:06
stable compat
diff --git a/src/lib.rs b/src/lib.rs index bae43b6..2f694c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,6 @@ extern crate log; extern crate bytes; #[macro_use] extern crate failure; -extern crate actix; extern crate futures; extern crate mio; extern crate net2; @@ -27,6 +26,9 @@ extern crate tokio_timer...
1
3
1
9456065d7bc33ed283b056e67f221d503fddb779
Nikolay Kim
2018-09-04T19:07:13
better error conversion impl for and_then
diff --git a/src/configurable.rs b/src/configurable.rs index 66eb584..614a491 100644 --- a/src/configurable.rs +++ b/src/configurable.rs @@ -259,14 +259,18 @@ where impl<A, B, C> NewConfigurableService<C> for AndThenNewConfigurableService<A, B, C> where - A: NewConfigurableService<C, Response = B::Request, InitE...
5
140
48
41eddae266ec4a088bbae8284037fe0e1bfbf432
Nikolay Kim
2018-09-04T16:57:47
move into fn service impl
diff --git a/src/service/fn_service.rs b/src/service/fn_service.rs index 6eee6c9..07c9df3 100644 --- a/src/service/fn_service.rs +++ b/src/service/fn_service.rs @@ -6,7 +6,7 @@ use futures::{ }; use tower_service::{NewService, Service}; -use super::IntoNewService; +use super::{IntoNewService, IntoService}; pub s...
2
16
16
0390ff37d362c4b2067fc2513189affb81628a09
Nikolay Kim
2018-09-04T16:49:21
Revert "use From/Into instead of custom IntoService and IntoNewService traits" This reverts commit 9441624827e18c0f5a90b23a6582c4c1e1a7b29a.
diff --git a/src/lib.rs b/src/lib.rs index 7369015..bae43b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,7 @@ mod worker; pub use configurable::{IntoNewConfigurableService, NewConfigurableService}; pub use server::Server; -pub use service::{NewServiceExt, ServiceExt}; +pub use service::{IntoNewService, Int...
7
72
25
dfa08b3bf1ab8c1991ba15d600ffab3071c24b2b
Nikolay Kim
2018-09-04T16:32:37
remove uneeded map_request
diff --git a/src/lib.rs b/src/lib.rs index 272339e..7369015 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,7 @@ extern crate log; extern crate bytes; #[macro_use] extern crate failure; +extern crate actix; extern crate futures; extern crate mio; extern crate net2; @@ -26,9 +27,6 @@ extern crate tokio_timer...
3
1
154
9441624827e18c0f5a90b23a6582c4c1e1a7b29a
Nikolay Kim
2018-09-04T16:30:52
use From/Into instead of custom IntoService and IntoNewService traits
diff --git a/src/lib.rs b/src/lib.rs index 2f694c7..272339e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,7 @@ mod worker; pub use configurable::{IntoNewConfigurableService, NewConfigurableService}; pub use server::Server; -pub use service::{IntoNewService, IntoService, NewServiceExt, ServiceExt}; +pub use ...
7
25
72
42a49da1999d1b3fa716791c1bed12e5af4dd68e
Nikolay Kim
2018-09-01T17:29:56
add StreamDispatcher
diff --git a/src/lib.rs b/src/lib.rs index b6ebaf5..2f694c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,7 @@ mod server; mod server_service; pub mod service; pub mod ssl; +pub mod stream; mod worker; pub use configurable::{IntoNewConfigurableService, NewConfigurableService}; diff --git a/src/stream.rs ...
2
91
0
27af05de9a4d74660de8805047d26c53ac0fbf3f
Nikolay Kim
2018-08-31T19:51:26
simplify Apply combinator
diff --git a/src/service/apply.rs b/src/service/apply.rs index a39663d..58755f6 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -1,24 +1,21 @@ use std::marker::PhantomData; -use futures::{Async, Future, Poll}; +use futures::{Async, Future, IntoFuture, Poll}; use {IntoNewService, NewService, Service}...
2
42
63
c2d73873cc8af7306305b6464b6bc8a68177f272
Nikolay Kim
2018-08-31T00:54:59
rename Apply combinator
diff --git a/src/service/apply.rs b/src/service/apply.rs index 0fa8d77..a39663d 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -4,7 +4,7 @@ use futures::{Async, Future, Poll}; use {IntoNewService, NewService, Service}; /// `ApplyService` service combinator -pub struct ApplyService<T, F, R, Req, Res...
2
23
26
7ff24863abc75cfabe034da0b57dc02b2bf0dcd2
Nikolay Kim
2018-08-31T00:46:11
add apply() combinator
diff --git a/src/service/apply.rs b/src/service/apply.rs index 508efb1..0fa8d77 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -1,7 +1,7 @@ use std::marker::PhantomData; use futures::{Async, Future, Poll}; -use {NewService, Service, IntoNewService}; +use {IntoNewService, NewService, Service}; //...
2
24
4
fbd17e43f314a5b757886212bdc8ef2fcaa7e833
Nikolay Kim
2018-08-30T22:12:01
fix ApplyService constraint
diff --git a/src/service/apply.rs b/src/service/apply.rs index c6b15a4..508efb1 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -16,6 +16,7 @@ pub struct ApplyService<T, F, R, Req, Resp, Err> { impl<T, F, R, Req, Resp, Err> ApplyService<T, F, R, Req, Resp, Err> where T: Service, + T::Error: In...
1
2
0
eaa9d4b273f70415d5695bd18a1ad7610e312764
Nikolay Kim
2018-08-30T17:06:47
allow to change Connector's request type
diff --git a/src/connector.rs b/src/connector.rs index 7665a1c..6bf949c 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -92,6 +92,13 @@ impl<T: HostAware> Connector<T> { > + Clone { move || -> FutureResult<Connector<T>, E> { ok(Connector::new(cfg.clone(), opts)) } } + + pub fn change_reque...
1
7
0
061a0339fffb2ce1b71ead0ee5fd09990007366e
Nikolay Kim
2018-08-30T16:38:09
convert to new service
diff --git a/src/service/apply.rs b/src/service/apply.rs index 03f4dd8..c6b15a4 100644 --- a/src/service/apply.rs +++ b/src/service/apply.rs @@ -1,7 +1,7 @@ use std::marker::PhantomData; use futures::{Async, Future, Poll}; -use {NewService, Service}; +use {NewService, Service, IntoNewService}; /// `ApplyService`...
1
3
3
a928d82895f341c6cab3291bc004690ccf50746f
Nikolay Kim
2018-08-30T16:26:27
rename Apply service
diff --git a/src/connector.rs b/src/connector.rs index 6458f80..7665a1c 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -90,9 +90,7 @@ impl<T: HostAware> Connector<T> { Error = ConnectorError, InitError = E, > + Clone { - move || -> FutureResult<Connector<T>, E> { - ok(C...
3
24
35
e0513e4085b98ef502529aa042db208941c5f48b
Nikolay Kim
2018-08-30T16:17:17
replace partial with more generic Apply
diff --git a/src/connector.rs b/src/connector.rs index 27a2976..6458f80 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -91,7 +91,7 @@ impl<T: HostAware> Connector<T> { InitError = E, > + Clone { move || -> FutureResult<Connector<T>, E> { - ok(Connector::new(cfg.clone(), opts.c...
4
188
196
42b0d53c16f318162fb7d71eeca60b672a908123
Nikolay Kim
2018-08-30T04:31:43
change AndThen InitError constrain
diff --git a/src/service/and_then.rs b/src/service/and_then.rs index 74d247e..2d24866 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -126,6 +126,7 @@ impl<A, B> NewService for AndThenNewService<A, B> where A: NewService<Response = B::Request, InitError = B::InitError>, A::Error: Into<B...
1
6
3
9b48e952b84dec6b342d308b2c7756214d9192bc
Nikolay Kim
2018-08-30T03:20:13
add map_request combinator
diff --git a/src/service/map_request.rs b/src/service/map_request.rs new file mode 100644 index 0000000..716fcf1 --- /dev/null +++ b/src/service/map_request.rs @@ -0,0 +1,141 @@ +use std::marker; + +use futures::{Async, Future, Poll}; +use {NewService, Service}; + +/// `MapReq` service combinator +pub struct MapReq<A, ...
2
151
0
77cf7016b714b02ab3eacad99a8e16f04ee2f2a6
Nikolay Kim
2018-08-30T03:06:33
add partial combinator
diff --git a/src/connector.rs b/src/connector.rs index d6e9a9c..27a2976 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -46,7 +46,7 @@ pub struct ConnectionInfo { pub addr: SocketAddr, } -pub struct Connector<T=String> { +pub struct Connector<T = String> { resolver: AsyncResolver, req: Phantom...
4
195
2
918c764641c0cf94e6388215ceaf9e99114ec67f
Nikolay Kim
2018-08-29T22:28:16
use String as default type for Connector
diff --git a/src/connector.rs b/src/connector.rs index faae08f..d6e9a9c 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -46,7 +46,7 @@ pub struct ConnectionInfo { pub addr: SocketAddr, } -pub struct Connector<T> { +pub struct Connector<T=String> { resolver: AsyncResolver, req: PhantomData<T>, ...
1
1
1
361ffd8d2fdf4e52f8f3f72632702f9c963a36e2
Nikolay Kim
2018-08-29T22:15:24
refactor Connector service
diff --git a/src/connector.rs b/src/connector.rs index f6ff75f..faae08f 100644 --- a/src/connector.rs +++ b/src/connector.rs @@ -1,5 +1,6 @@ use std::collections::VecDeque; use std::io; +use std::marker::PhantomData; use std::net::SocketAddr; use futures::{ @@ -15,6 +16,16 @@ use trust_dns_resolver::{AsyncResolve...
3
115
70
7ec92f7b1c642ea1f07bef9f1db2442ba706c35b
Nikolay Kim
2018-08-29T19:26:27
export ServiceExt trait
diff --git a/src/lib.rs b/src/lib.rs index d34d90e..65b15ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,7 @@ mod worker; pub use configurable::{IntoNewConfigurableService, NewConfigurableService}; pub use connector::{ConnectionInfo, Connector, ConnectorError}; pub use server::Server; -pub use service::{Int...
1
1
1
eeb4f8c61c3c9bf347356573b17159807496c699
Nikolay Kim
2018-08-29T19:20:35
add Service combinators
diff --git a/src/service/mod.rs b/src/service/mod.rs index 7cfca59..553f35e 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -9,12 +9,39 @@ mod map_err; mod map_init_err; pub use self::and_then::{AndThen, AndThenNewService}; -pub use self::fn_service::{FnService, FnNewService}; -pub use self::fn_state_se...
1
33
5
6f607e79db21a9c42941903c74efc3015222c6d4
Nikolay Kim
2018-08-29T05:28:13
export configurable mod
diff --git a/src/lib.rs b/src/lib.rs index 79c3834..d34d90e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,7 +52,7 @@ use actix::Message; pub use tower_service::{NewService, Service}; pub(crate) mod accept; -mod configurable; +pub mod configurable; mod connector; mod server; mod server_service;
1
1
1