-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Thanks for wiremock! It seems that it's currently not possible to execute async code in the respond method or respond trait. It'd be useful to have it natively supported by wiremock.
Wasn't able to find a workaround, tried
.respond_with(move |req: &Request| {
let handle = tokio::runtime::Handle::current();
std::thread::spawn(move || {
handle.block_on(async {
// Some async call
});
})
.join()
.unwrap();
ResponseTemplate::new(200)
})
but that's blocking the tokio runtime since the test runs as #[tokio::test]
.
tamasfe, rminderhoud, dcormier, bbaldino, robjtede and 1 more
Metadata
Metadata
Assignees
Labels
No labels