• karol retitled this revision from [draft] [services] Backup - Add client reactor base classes to [draft] [services] Backup - Add client reactor base classes - bidi reactor.
Do we access this from multiple threads? Does it need to be atomic?
It might be a good idea to investigate reactors in context of threading. It may be the case that we don't need to make this atomic and library takes care of synchronizing the memory, but it is also possible that we need to do that and currently have a lot of subtle bugs.
Thanks for the clarification. It looks like term initialized confused me as initialization usually happens before any operation - maybe we can find a less confusing name? Alternatively, in the examples you linked, this call happens in the constructor. Is it possible to use the same approach here?
This cannot be done, because prepareRequest is being called here and it is a pure virtual function. What happens when we create an object of a derived class is, first the constructor of the base class is being called. And in the base class, we have only the pure virtual version of this method, therefore we have to call nextWrite (and effectively prepareRequest) explicitly on an object of the derived class.
• karol retitled this revision from [draft] [services] Backup - Add client reactor base classes - bidi reactor to [services] Backup - Add client reactor base classes - bidi reactor.
Is that the case that when status is non null, done is always true? If that's the case, maybe we don't need done and in isDone we can return this->status != null
This can be probably achieved by calling get method on a shared pointer - for me it's less confusing, but up to you: if you prefer the current approach we can keep it
The problem is, this->status cannot be nullptr because it is not a pointer, just a normal object of a class. So I guess it has some initial values(like error code 0). We could keep status as a smart pointer, but I'd keep it consistent across all reactor base classes so if you feel we need this, I can create a task and do it later.