-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use in an actix server? #16
Comments
Hi @liebkne! See https://docs.rs/batched-fn/latest/batched_fn/#implementation-details, in particular:
All three arguments ( I hope that answers your question! I haven't used |
That's great help! Thank you very much! Following you hints, I spent some time to understand the macro and I think I've understood 90% of it. 😂 I will try to make a working example and once I did I will make a PR. |
Great! Looking forward to it 🙂 |
I'm also pretty new to Rust and async things and found a tutorial from tokio-channel. After I read the source code I found the pattern (using channels) of the library is similar. @epwalsh May I ask a question? Why |
@Yevgnen, great question! I'm glad you asked because it turns out it's actually not needed since |
Hi, thanks for this library!
I'm trying to use the library to write a demo using
rust-bert
andactix
. When I tried to put the model inbatched_fn!
, I got error likeNeed the model be
Sync
andSend
? I know there's arust-dl-webserver
project but I'm not quite understand the mechanism differences betweenactix
andwarp
as I'm pretty new to Rust. Can you provide an simpleactix
example or help me understand the usage withbatched_fn!
? e.g. How doescontext
,config
,handler
works? Are they all required? Is the code insidecontext
run only once for initialization (like loading the model)? Should one put other fields besidemodel
incontext
?Many thanks.
The text was updated successfully, but these errors were encountered: