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
For the case where a web request triggers a task on a queue to later execute: is it ok if the eliot action originally in the request has "finished" already, but the async task running in another process still adds messages to the sub-action?
Pseudocode (Django-ish, Celery-ish):
# in the web process handling requestsdefa_view(request):
witheliot.start_action('my-web-request') asaction:
my_background_task.delay(
eliot_action_uuid=action.serialize_task_id().decode('ascii')
)
# at this point the action as already finished, but the code in# my_background_task has not run yet.
# in a worker process handling background tasksdefmy_background_task(eliot_action_uuid):
witheliot.Action.continue_task(task_id=eliot_action_uuid):
# here we're logging stuff somewhere in the subtree of an # action that is actually already "finished".do_stuff()
Is this ok? Or should this be avoided?
The text was updated successfully, but these errors were encountered:
This is OK, yes - it's one of the reasons Eliot does causal ordering rather than time-based ordering. It makes certain use cases (e.g. profiling) trickier, but it's an accurate representation of many situations.
This should probably be some sort of FAQ or documentation entry, so leaving issue open for that.
For the case where a web request triggers a task on a queue to later execute: is it ok if the eliot action originally in the request has "finished" already, but the async task running in another process still adds messages to the sub-action?
Pseudocode (Django-ish, Celery-ish):
Is this ok? Or should this be avoided?
The text was updated successfully, but these errors were encountered: