[Interest] interobject communication model and control flow
shkodindanil.letmework at gmail.com
Tue Aug 20 16:11:29 CEST 2019
I am in the middle of refactoring a library, which I am going to publish
I found mysefl stuck reconsidering API in terms of interobject
There is a central class that have several signals, and I try to imagine
what library user could do in corresponding slots:
Should deleting an instance be possible from directly connected slot?
What should happen if one reenters event loop in a directly connected slot?
Should processing continue or lock?
In general, API is asynchronous in sense that methods just set some target
state and use queued connection to do processing from event loop and
signals just mark some events.
Qt itself has nice documentation that, for example, flags some method to be
reentrant or thead safe. But synchronous or asynchronous, event loop
reentry or deletion behavior is rarely described in detailed section. So I
struggle to find a reference implementation.
Does anyone consider these problems designing or using APIs?
Do you expect an object to continue processing even if control flow was
taken into event loop via direct signal slot connection?
What is the correct term or category to define event loop reentry safety?
Will appreciate any comments.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest