Skip to content

Commit

Permalink
Merge pull request #165 from dispatchrun/dispatch-batch
Browse files Browse the repository at this point in the history
Add top-level dispatch.batch helper function
  • Loading branch information
chriso authored May 13, 2024
2 parents 1988b74 + d5726e3 commit 833793e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dispatch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import dispatch.integrations
from dispatch.coroutine import all, any, call, gather, race
from dispatch.function import DEFAULT_API_URL, Client, Function, Registry, Reset
from dispatch.function import DEFAULT_API_URL, Batch, Client, Function, Registry, Reset
from dispatch.http import Dispatch
from dispatch.id import DispatchID
from dispatch.proto import Call, Error, Input, Output
Expand Down Expand Up @@ -96,3 +96,8 @@ def run(init: Optional[Callable[P, None]] = None, *args: P.args, **kwargs: P.kwa
finally:
server.shutdown()
server.server_close()


def batch() -> Batch:
"""Create a new batch object."""
return default_registry().batch()

0 comments on commit 833793e

Please sign in to comment.