executorlib.standalone.batched.batched_futures

executorlib.standalone.batched.batched_futures#

executorlib.standalone.batched.batched_futures(lst: list[Future], nested_skip_lst: list[Future[list]], n: int) tuple[bool, list[Future]][source]#

Batch n completed future objects. If the number of completed futures is smaller than n and the end of the batch is not reached yet, then an empty list is returned. If n future objects are done, which are not included in the skip_set then they are returned as batch.

Parameters:
  • lst (list) – list of all future objects

  • nested_skip_lst (list) – list of future objects, which contain the list of future objects ids which should be skipped for the batch

  • n (int) – batch size

Returns:

results of the batched futures

Return type:

list