Skip to content

Commit

Permalink
update rust packages to latest (sparckles#298)
Browse files Browse the repository at this point in the history
* update rust packages to latest

* fix clippy issues

* fix package version
  • Loading branch information
suhailmalik07 authored and Shending-Help committed Nov 3, 2022
1 parent 230bb64 commit bc8abe0
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 208 deletions.
165 changes: 53 additions & 112 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ name = "robyn"
crate-type = ["cdylib", "rlib"]

[dependencies.pyo3]
version = "0.14.1"
version = "0.17.2"
features = ["extension-module"]

[dependencies]
tokio = { version = "1.7.0", features = ["full"] }
dashmap = {git = "https://github.com/quake/dashmap", branch = "parking_lot", features = ["parking_lot"]}
pyo3-asyncio = { version="0.14.0" , features = ["attributes", "tokio-runtime"] }
pyo3-asyncio = { version="0.17.0" , features = ["attributes", "tokio-runtime"] }
anyhow = "1.0.38"
actix-web = "4.0.1"
actix-files = "0.6.0"
futures-util = "0.3.15"
matchit = "0.4.3"
matchit = "0.6.0"
actix-http = "3.0.4"
socket2 = { version = "0.4.1", features = ["all"] }
actix = "0.13.0"
actix-web-actors = "4.1.0"
uuid = { version = "0.8", features = ["serde", "v4"] }
uuid = { version = "1.2.1", features = ["serde", "v4"] }
serde = "1.0.136"
serde_json = "1.0.79"
futures = "0.3.21"
pyo3-log = "0.4.1"
pyo3-log = "0.7.0"
log = "0.4.17"

[features]
Expand Down
13 changes: 6 additions & 7 deletions src/executors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ use std::collections::HashMap;
use std::rc::Rc;
use std::sync::Arc;


use actix_web::HttpResponse;

use actix_web::{ HttpRequest};
use anyhow::{ Result};
use actix_web::{http::Method, web, HttpRequest};
use anyhow::{bail, Result};
use log::{debug, info};
use pyo3_asyncio::TaskLocals;
// pyO3 module
use crate::types::PyFunction;

Expand Down Expand Up @@ -306,7 +305,7 @@ pub async fn execute_http_function(

pub async fn execute_event_handler(
event_handler: Option<Arc<PyFunction>>,
event_loop: Arc<Py<PyAny>>,
task_locals: &TaskLocals,
) -> Result<(), Box<dyn std::error::Error>> {
if let Some(handler) = event_handler {
match &(*handler) {
Expand All @@ -322,8 +321,8 @@ pub async fn execute_event_handler(
debug!("Startup event handler async");

let coroutine = function.as_ref(py).call0().unwrap();
pyo3_asyncio::into_future_with_loop((*event_loop).as_ref(py), coroutine)
.unwrap()

pyo3_asyncio::into_future_with_locals(task_locals, coroutine).unwrap()
});
future.await?;
}
Expand Down
Loading

0 comments on commit bc8abe0

Please sign in to comment.