Closed Mayukhdeb closed 3 years ago
There should be a way for the client to know how far the task is complete while it's running.
Instead of:
{'status': 'running'}
it could be returnning a progress value where 0 = just started and 1. = complete.
progress
{'status': 'running', 'progress' : '0.3'}
and this can be integrated into run() function as:
@eden_block.run(args = my_args, progress = True) def do_something(config): # other stuff for i in range(100): config['__progress__'].update(0.01)
and the ajax jquery might look like:
if (status == 'completed') { $('#status').html(''); refresh_creations(); } else if (status == 'running'){ var status_str = 'Task '+task_id+' is running. Progress: ' + request.getResponseHeader('progress'); $('#status').html(status_str); setTimeout(function() { check_status(); }, 5000);
Progress gets tracked with ProgressTracker. It can be used within the block as https://github.com/abraham-ai/eden/blob/26cedda3bbf1507fea3a42a5cf4aa66366d96ab5/server_example.py#L21-L22
ProgressTracker
There should be a way for the client to know how far the task is complete while it's running.
Instead of:
it could be returnning a
progress
value where 0 = just started and 1. = complete.and this can be integrated into run() function as:
and the ajax jquery might look like: