billyb2 / bootleg_networking

A cross platform (wasm included) networking library!
MIT License
56 stars 5 forks source link

Implement clone for web runtime #1

Closed IsseW closed 2 years ago

IsseW commented 2 years ago

this allows for the pattern

let net = NetworkResource::new_client(tokio_rt.clone(), task_pool.0.clone());

for both native and web.

Not sure about not having Option on the parameter though.

billyb2 commented 2 years ago

Thank you for the PR! I fully agree that removing the Option is probably a good idea, since we already insert the fake Runtime for web builds anyway.