Replies: 2 comments 8 replies
-
|
I'm not entirely convinced the use of When I execute a All this is really doing is calling another method I'll agree however, that if this approach exists I think a method is preferable to an Arg. I like the more functional approach. But this type of feature anticipates that things execute incredibly rapidly. Having a script execute for 5 hours simply making pings is not a useful design in the SDK. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot for bringing this up! Letting users wait for the results of an existing batch seems like a basic feature that should for sure be available in the SDK. I'm pretty sure we had this at some point but it looks like it was removed by mistake when the We should definitely work on that. As per the interface and implementation for this feature, I also think adding a dedicated method would be nice for the reasons you mentioned. I think the batch = create_batch(sequence)
batch.await()
postprocess(batch.jobs[0].results)No strong opinion on the naming just yet, I like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A
waitmethod for batchesThat would be in addition of being available as an argument in the
add_job,retryandclosemethods.Why a new method?
The "refresh-and-check-state" mechanism is currently re-implemented in several methods, but not accessible to the user, only as an argument in other methods.
The reasons to add this method would be:
wait, or if the waiting loop breaks down (e.g. until the above-mentioned issue is not implemented), then you have no easy way of doing it aside from rewriting the wait loop yourself, potentially introducing some errors yourself (e.g. forgetting some states).waited) and the moment when the user actually needs the results (without adding new jobs or closing the batch to force thewaitmechanism)Naming
The name of the method itself is up for discussion.
I see the following options, but there obviously could be more:
my_batch.wait()my_batch.await()my_batch.wait_for()my_batch.wait_settled()(inspired by JS promises)Arguments
The methods could have the following argument:
retry5xx: booleanto retry (not raise an error) on 5xx status codes from the backend (default:true) - implemented with Add retries when one request returns a 500 while waiting for results (workloads/batches/jobs) #110Beta Was this translation helpful? Give feedback.
All reactions