mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 18:09:22 +02:00
update example to use actix 0.4
This commit is contained in:
@ -27,9 +27,9 @@ impl Actor for DbExecutor {
|
||||
}
|
||||
|
||||
impl Handler<CreateUser> for DbExecutor {
|
||||
fn handle(&mut self, msg: CreateUser, _: &mut Self::Context)
|
||||
-> Response<Self, CreateUser>
|
||||
{
|
||||
type Result = MessageResult<CreateUser>;
|
||||
|
||||
fn handle(&mut self, msg: CreateUser, _: &mut Self::Context) -> Self::Result {
|
||||
use self::schema::users::dsl::*;
|
||||
|
||||
let uuid = format!("{}", uuid::Uuid::new_v4());
|
||||
@ -48,6 +48,6 @@ impl Handler<CreateUser> for DbExecutor {
|
||||
.load::<models::User>(&self.0)
|
||||
.expect("Error loading person");
|
||||
|
||||
Self::reply(items.pop().unwrap())
|
||||
Ok(items.pop().unwrap())
|
||||
}
|
||||
}
|
||||
|
@ -18,8 +18,6 @@ extern crate env_logger;
|
||||
|
||||
use actix::*;
|
||||
use actix_web::*;
|
||||
use actix::prelude::*;
|
||||
#[cfg(unix)]
|
||||
use actix::actors::signal::{ProcessSignals, Subscribe};
|
||||
|
||||
use diesel::prelude::*;
|
||||
@ -72,9 +70,8 @@ fn main() {
|
||||
.start();
|
||||
|
||||
// Subscribe to unix signals
|
||||
#[cfg(unix)]
|
||||
{ let signals = actix::Arbiter::system_registry().get::<ProcessSignals>();
|
||||
signals.send(Subscribe(_addr.subscriber())); }
|
||||
let signals = actix::Arbiter::system_registry().get::<ProcessSignals>();
|
||||
signals.send(Subscribe(_addr.subscriber()));
|
||||
|
||||
println!("Started http server: 127.0.0.1:8080");
|
||||
let _ = sys.run();
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user