Depends on D5035
In order to be able to handle multiple connections at the same time, we have to store a collection of clients in the rust state instead of having just one.
Here, I'm making the c++ calls to rust for the put client valid.
Differential D5036
[services] Rust Integration - Backup - c++ - Multiple put clients • karol on Sep 2 2022, 3:52 AM. Authored by Tags None Referenced Files
Details Depends on D5035 In order to be able to handle multiple connections at the same time, we have to store a collection of clients in the rust state instead of having just one. Here, I'm making the c++ calls to rust for the put client valid. cd services yarn run-integration-tests backup
Diff Detail
Event TimelineComment Actions Can we avoid having to put an additional argument to every call? This is error-prone. Comment Actions I think so, I'm not sure if this is so much error-prone, why? We have to specify what holder do we refer to. I don't know how else would we do that. Comment Actions If all the functions share the same context, we can create a struct and make functions methods of this struct (described in D5036).
In each function we need to remember to pass exactly the same string. The problem is that we accept any string as a type, so the only way to make sure we use the same value is by careful reading, which isn't maintainable. If the solution with struct is a hard one, we can consider keeping this approach, but maybe there are other ways of achieving that. Comment Actions I see your point. I would go with a follow-up for this as it looks uncertain and it may be quite a lot of work/refactoring. https://linear.app/comm/issue/ENG-1759/avoid-specifying-context-for-each-rust-function
|