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
To be able to trigger on change we need to store a value, check it, and when it's different than the last one, store the new and move on. I think it's a different function than f because:
f doesn't know the cycle's name (could be solved but not ideal)
I'm not sure if this can work in the background because we need to set the new value right after checking
So I believe we need a trigger arg, that's an argument-less function that returns a small value that identifies the state, for instance the date of the last received email if the feature is to notify new emails.
The text was updated successfully, but these errors were encountered:
We also want to be able to store metadata that can be use by the hook
both the hook and the trigger should be able to get the meta data
and set it when possible (maybe background processes cannot store metadata ? we would need a hook when they finish, or poll them during the process, but it's complicated)
Now that we have the arg trigger, renaming f to hook might make sense.
I think we need to unify the API of new_cycle() and new_cycle_bg(), the hook in new_cycle() should also have args, and these are also set in the function's env. The function's env however should be a child of {stats} so our hooks cannot be corrupted by overrides values in the global env.
in the hook and the trigger's env we can have bindings to the cycle's metadata, excluding the process maybe because it's not useful and would be wrong in a background cycle.
A problem is that the hook not only doesn't know its name but its doesn't know its cycle either.
The hook can change the meta data we'd store in its environment but that won't change the cycle.
This can be synchronised when looping on cycles but I think w don't need this data in the cycle anyway, as long as it's contained in the env.
To be able to trigger on change we need to store a value, check it, and when it's different than the last one, store the new and move on. I think it's a different function than
f
because:f
doesn't know the cycle's name (could be solved but not ideal)So I believe we need a trigger arg, that's an argument-less function that returns a small value that identifies the state, for instance the date of the last received email if the feature is to notify new emails.
The text was updated successfully, but these errors were encountered: