Skip to content

Commit

Permalink
rollback deadpool and deadpool postgres (#1831)
Browse files Browse the repository at this point in the history
we still build with rust 1.74 in CI which means we can't have latest
versions of these packages for now
  • Loading branch information
siddhantk232 authored Apr 4, 2024
1 parent 68712d4 commit d9b7dc9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ actix-http = "3"
antidote = "1"
dirs = "5"
native-tls = "0.2"
deadpool-postgres = "0.13"
deadpool = "0.11"
deadpool-postgres = "0.12"
deadpool = "0.10"
postgres-native-tls = "0.5"
tokio-postgres = { version = "0.7", features = ["with-serde_json-1", "with-uuid-1"] }
postgres-types = "0.2"
Expand Down
31 changes: 22 additions & 9 deletions fastn-ds/src/wasm/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@ async fn _dealloc(
.into_func()
.expect("dealloc is not a func");

dealloc
let res = dealloc
.call_async(caller, &[wasmtime::Val::I32(ptr)], &mut result)
.await
.inspect_err(|e| println!("got error when calling func: {e:?}"))
.await;

if let Err(ref e) = res {
println!("got error when calling dealloc: {e:?}");
}

res
}

async fn _dealloc_with_len(
Expand All @@ -89,14 +94,19 @@ async fn _dealloc_with_len(
.into_func()
.expect("dealloc_with_len is not a func");

dealloc_with_len
let res = dealloc_with_len
.call_async(
caller,
&[wasmtime::Val::I32(ptr), wasmtime::Val::I32(len)],
&mut result,
)
.await
.inspect_err(|e| println!("got error when calling func: {e:?}"))
.await;

if let Err(ref e) = res {
println!("got error when calling func: {e:?}");
}

res
}

async fn alloc(
Expand All @@ -110,10 +120,13 @@ async fn alloc(
.into_func()
.expect("alloc is not a func");

alloc
let res = alloc
.call_async(caller, &[wasmtime::Val::I32(size)], &mut result)
.await
.inspect_err(|e| println!("got error when calling func: {e:?}"))?;
.await;

if let Err(ref e) = res {
println!("got error when calling func: {e:?}");
}

Ok(result[0].i32().expect("result is not i32"))
}

0 comments on commit d9b7dc9

Please sign in to comment.