Skip to content

Comments

Remove extra deinit loads#2

Open
sajacl wants to merge 1 commit intokiarashvosough1999:mainfrom
sajacl:remove-deinit-extra-load
Open

Remove extra deinit loads#2
sajacl wants to merge 1 commit intokiarashvosough1999:mainfrom
sajacl:remove-deinit-extra-load

Conversation

@sajacl
Copy link

@sajacl sajacl commented Feb 22, 2026

Problem statement

Having deinit to do a cancelation in this sense can arguably lead to unnecessary load and conflict of intrests.

If a task has been fired already, but the bag gets de-allocated, the task will be canceled.

Consider an update task that fetches data, and stores them on disk.
This task lives in a module B, and the owner of the bag is module B.

Having such a flow, and creating a bag to maintain the task will result in two possible scenarios:

  1. Creating a task that outlives a module lifecycle, such as creating it as static (might be singleton, might not).
  2. Create it on the parent of module B, module A per say.

Going from A -> B, either task gets automatically canceled, or dependencies needs to be aligned to keep this task alive after the end of module B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant