You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I question the desirability of a reusable ReadClient and the attendant lifetime-management complexity being foisted on the SDK consumer. There are various things we could do to make this better, and some of them can probably be done on top of this PR, so I'm not going to block it, but I think we should very seriously think about something that would be both safer and easier to use.
For example, we could have a ReadClientHandle that allows move-construction and move-assignment only, except from inside the IM engine. The handle would point to a client and vice versa, with destructors cleaning up the references, and the move stuff on handle updating them. You could compare a handle to a client pointer, and you could shut the client down via the handle, but that's all you could do with a handle. When the client is done, it would shut itself down and null out the handle. This would guarantee that (a) you don't have to worry about shutting down the read client unless you want to terminate an in-progress read and (b) you can't mess up and shut down a different read from the one you meant to shut down because you kept a pointer to something around past a certain point. Please strongly consider filing a followup bug on this.
I question the desirability of a reusable ReadClient and the attendant lifetime-management complexity being foisted on the SDK consumer. There are various things we could do to make this better, and some of them can probably be done on top of this PR, so I'm not going to block it, but I think we should very seriously think about something that would be both safer and easier to use.
For example, we could have a ReadClientHandle that allows move-construction and move-assignment only, except from inside the IM engine. The handle would point to a client and vice versa, with destructors cleaning up the references, and the move stuff on handle updating them. You could compare a handle to a client pointer, and you could shut the client down via the handle, but that's all you could do with a handle. When the client is done, it would shut itself down and null out the handle. This would guarantee that (a) you don't have to worry about shutting down the read client unless you want to terminate an in-progress read and (b) you can't mess up and shut down a different read from the one you meant to shut down because you kept a pointer to something around past a certain point. Please strongly consider filing a followup bug on this.
#5198 (review)
The text was updated successfully, but these errors were encountered: