Skip to content

Instantly share code, notes, and snippets.

@rippinrobr
Created May 27, 2018 13:28
Show Gist options
  • Save rippinrobr/739c0cf5a5680c625ed5263757ff2e9f to your computer and use it in GitHub Desktop.
Save rippinrobr/739c0cf5a5680c625ed5263757ff2e9f to your computer and use it in GitHub Desktop.
A reminder of what the chained function calls look like that process the returned value from the actor
// Send message to `DbExecutor` actor
req.state().db.send(GetConspiracy{page_id: page_id.to_owned()})
.from_err()
.and_then(|res| {
match res {
Ok(conspiracy) => Ok(HttpResponse::Ok().json(conspiracy)),
Err(_) => Ok(HttpResponse::NotFound().into())
}
})
.responder()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment