mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 09:59:21 +02:00
switch to actix master
This commit is contained in:
@ -6,7 +6,7 @@ use std::{fmt, io, mem, time};
|
||||
use actix::resolver::{Connect as ResolveConnect, Resolver, ResolverError};
|
||||
use actix::{
|
||||
fut, Actor, ActorContext, ActorFuture, ActorResponse, Addr, AsyncContext, Context,
|
||||
ContextFutureSpawner, Handler, Message, Recipient, StreamHandler, Supervised,
|
||||
ContextFutureSpawner, Handler, Message, Recipient, StreamHandler2, Supervised,
|
||||
SystemService, WrapFuture,
|
||||
};
|
||||
|
||||
@ -220,7 +220,7 @@ impl Actor for ClientConnector {
|
||||
self.resolver = Some(Resolver::from_registry())
|
||||
}
|
||||
self.collect_periodic(ctx);
|
||||
ctx.add_stream(self.acq_rx.take().unwrap());
|
||||
ctx.add_stream2(self.acq_rx.take().unwrap());
|
||||
ctx.spawn(Maintenance);
|
||||
}
|
||||
}
|
||||
@ -767,7 +767,7 @@ impl Handler<Connect> for ClientConnector {
|
||||
}
|
||||
}
|
||||
|
||||
impl StreamHandler<AcquiredConnOperation, ()> for ClientConnector {
|
||||
impl StreamHandler2<AcquiredConnOperation, ()> for ClientConnector {
|
||||
fn handle(
|
||||
&mut self, msg: Result<Option<AcquiredConnOperation>, ()>,
|
||||
ctx: &mut Context<Self>,
|
||||
|
@ -972,7 +972,7 @@ impl InnerHttpResponse {
|
||||
}
|
||||
}
|
||||
|
||||
/// Internal use only! unsafe
|
||||
/// Internal use only!
|
||||
pub(crate) struct HttpResponsePool(VecDeque<Box<InnerHttpResponse>>);
|
||||
|
||||
thread_local!(static POOL: Rc<UnsafeCell<HttpResponsePool>> = HttpResponsePool::pool());
|
||||
|
@ -309,7 +309,7 @@ impl Resource {
|
||||
params.set_tail(len as u16);
|
||||
for (idx, segment) in segments.iter().enumerate() {
|
||||
// reason: Router is part of App, which is unique per thread
|
||||
// app is alive during whole life of tthread
|
||||
// app is alive during whole life of a thread
|
||||
let name = unsafe { &*(names[idx].as_str() as *const _) };
|
||||
params.add(name, *segment);
|
||||
}
|
||||
@ -378,7 +378,7 @@ impl Resource {
|
||||
params.set_tail(tail_len as u16);
|
||||
for (idx, segment) in segments.iter().enumerate() {
|
||||
// reason: Router is part of App, which is unique per thread
|
||||
// app is alive during whole life of tthread
|
||||
// app is alive during whole life of a thread
|
||||
let name = unsafe { &*(names[idx].as_str() as *const _) };
|
||||
params.add(name, *segment);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ use std::{io, net, thread};
|
||||
|
||||
use actix::{
|
||||
fut, signal, Actor, ActorFuture, Addr, Arbiter, AsyncContext, Context, Handler,
|
||||
Response, StreamHandler, System, WrapFuture,
|
||||
Response, StreamHandler2, System, WrapFuture,
|
||||
};
|
||||
|
||||
use futures::sync::mpsc;
|
||||
@ -449,7 +449,7 @@ impl<H: IntoHttpHandler> HttpServer<H> {
|
||||
// start http server actor
|
||||
let signals = self.subscribe_to_signals();
|
||||
let addr = Actor::create(move |ctx| {
|
||||
ctx.add_stream(rx);
|
||||
ctx.add_stream2(rx);
|
||||
self
|
||||
});
|
||||
if let Some(signals) = signals {
|
||||
@ -611,7 +611,7 @@ impl<H: IntoHttpHandler> Handler<signal::Signal> for HttpServer<H> {
|
||||
}
|
||||
|
||||
/// Commands from accept threads
|
||||
impl<H: IntoHttpHandler> StreamHandler<ServerCommand, ()> for HttpServer<H> {
|
||||
impl<H: IntoHttpHandler> StreamHandler2<ServerCommand, ()> for HttpServer<H> {
|
||||
fn handle(&mut self, msg: Result<Option<ServerCommand>, ()>, _: &mut Context<Self>) {
|
||||
if let Ok(Some(ServerCommand::WorkerDied(idx, socks))) = msg {
|
||||
let mut found = false;
|
||||
|
Reference in New Issue
Block a user