Closed pslacerda closed 6 years ago
Are pull requests welcome for both this issue and #490?
I'm not convinced we should support finalization on components.
They should just be a way of providing some argument to a function and not also support a bunch of implicit setup/teardown logic.
Similarly #546
In fact isn't the same issue as there is more than one way to address that issue (with components or with hooks). I'm saying here to use components.
In 3.x was possible to
yield
a component with theinit
function, so initialization and deinitialization was really possible. Currently the only workaround is to use hooks, which a bit confusing because a component code is then scattered in both components and hooks. However even hooks can't work everytime because different component isntances are given to the hook and handler (#490, for exempleon_error
hooks).The impact of this is that is really impossible to finalize components. The only workaround that I can imagine is to use
threading.local
which is really strange for a single threaded model.Any thoughts on this?