Skip to content

Commit 833793e

Browse files
authored
Merge pull request #165 from dispatchrun/dispatch-batch
Add top-level dispatch.batch helper function
2 parents 1988b74 + d5726e3 commit 833793e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dispatch/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import dispatch.integrations
1414
from dispatch.coroutine import all, any, call, gather, race
15-
from dispatch.function import DEFAULT_API_URL, Client, Function, Registry, Reset
15+
from dispatch.function import DEFAULT_API_URL, Batch, Client, Function, Registry, Reset
1616
from dispatch.http import Dispatch
1717
from dispatch.id import DispatchID
1818
from dispatch.proto import Call, Error, Input, Output
@@ -96,3 +96,8 @@ def run(init: Optional[Callable[P, None]] = None, *args: P.args, **kwargs: P.kwa
9696
finally:
9797
server.shutdown()
9898
server.server_close()
99+
100+
101+
def batch() -> Batch:
102+
"""Create a new batch object."""
103+
return default_registry().batch()

0 commit comments

Comments
 (0)