Hi,
I try to use NoProto and Sled as a simple DB and figured it would make sense to parse the Schema only once.
However, its all across an async code base and the inserts and updates would come only after some awaits happened.
This is seems to be a roadblock with NoProto, as NP_Factory is not Send.
I basically
start a Server
create a NP_Factory
wait for IO to happen
want to store that IO
Compiling my simple PoC gives me:
error: future cannot be sent between threads safely
--> src/main.rs:82:38
|
82 | let server = Server::bind(&addr).serve(make_service);
| ^^^^^ future returned by `proxy` is not `Send`
|
= help: within `no_proto::NP_Factory`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<no_proto::schema::NP_Schema>`
note: future is not `Send` as this value is used across an await
I guess an Arc instead of an Rc (in NP_Factory and NP_SchemaKinds) would solve it.
Or am I doing it wrong?
Hi, I try to use NoProto and Sled as a simple DB and figured it would make sense to parse the Schema only once. However, its all across an async code base and the inserts and updates would come only after some awaits happened. This is seems to be a roadblock with NoProto, as
NP_Factory
is notSend
.I basically
Compiling my simple PoC gives me:
I guess an
Arc
instead of anRc
(inNP_Factory
andNP_SchemaKinds
) would solve it. Or am I doing it wrong?