Skip to content

Commit

Permalink
Implement Send, Sync and Clone for Fetcher (#503)
Browse files Browse the repository at this point in the history
* Derive clone for Fetcher

* Implement Send and Sync for Fetcher
  • Loading branch information
avsaase authored Mar 27, 2024
1 parent 5de3d40 commit 340177c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions worker-sys/src/types/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ extern "C" {
init: &web_sys::RequestInit,
) -> js_sys::Promise;
}

unsafe impl Send for Fetcher {}
unsafe impl Sync for Fetcher {}
1 change: 1 addition & 0 deletions worker/src/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use wasm_bindgen_futures::JsFuture;
use crate::{HttpRequest, HttpResponse};
use crate::{Request, Response};
/// A struct for invoking fetch events to other Workers.
#[derive(Clone)]
pub struct Fetcher(worker_sys::Fetcher);

#[cfg(not(feature = "http"))]
Expand Down

0 comments on commit 340177c

Please sign in to comment.