wool 0.1rc13__py3-none-any.whl → 0.1rc15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wool might be problematic. Click here for more details.
- wool/__init__.py +1 -26
- wool/_connection.py +247 -0
- wool/_context.py +29 -0
- wool/_loadbalancer.py +213 -0
- wool/_protobuf/task_pb2_grpc.py +2 -2
- wool/_protobuf/worker_pb2.py +6 -6
- wool/_protobuf/worker_pb2.pyi +4 -4
- wool/_protobuf/worker_pb2_grpc.py +2 -2
- wool/_resource_pool.py +3 -3
- wool/_undefined.py +11 -0
- wool/_work.py +5 -4
- wool/_worker.py +115 -426
- wool/_worker_discovery.py +24 -36
- wool/_worker_pool.py +46 -31
- wool/_worker_proxy.py +54 -186
- wool/_worker_service.py +243 -0
- {wool-0.1rc13.dist-info → wool-0.1rc15.dist-info}/METADATA +153 -41
- wool-0.1rc15.dist-info/RECORD +27 -0
- wool-0.1rc13.dist-info/RECORD +0 -22
- {wool-0.1rc13.dist-info → wool-0.1rc15.dist-info}/WHEEL +0 -0
- {wool-0.1rc13.dist-info → wool-0.1rc15.dist-info}/entry_points.txt +0 -0
wool/_work.py
CHANGED
|
@@ -30,6 +30,7 @@ from uuid import uuid4
|
|
|
30
30
|
import cloudpickle
|
|
31
31
|
|
|
32
32
|
import wool
|
|
33
|
+
from wool import _context as ctx
|
|
33
34
|
from wool import _protobuf as pb
|
|
34
35
|
from wool._typing import PassthroughDecorator
|
|
35
36
|
|
|
@@ -171,7 +172,7 @@ def _dispatch(
|
|
|
171
172
|
tag=f"{module}.{qualname}({signature})",
|
|
172
173
|
proxy=proxy,
|
|
173
174
|
)
|
|
174
|
-
return proxy.dispatch(task)
|
|
175
|
+
return proxy.dispatch(task, timeout=ctx.dispatch_timeout.get())
|
|
175
176
|
|
|
176
177
|
|
|
177
178
|
async def _execute(fn: AsyncCallable, parent, *args, **kwargs):
|
|
@@ -187,7 +188,7 @@ async def _execute(fn: AsyncCallable, parent, *args, **kwargs):
|
|
|
187
188
|
|
|
188
189
|
async def _stream_to_coroutine(stream):
|
|
189
190
|
result = None
|
|
190
|
-
async for result in stream:
|
|
191
|
+
async for result in await stream:
|
|
191
192
|
continue
|
|
192
193
|
return result
|
|
193
194
|
|
|
@@ -412,7 +413,7 @@ class WoolTaskEvent:
|
|
|
412
413
|
:param type:
|
|
413
414
|
The type of task event (e.g., "task-created", "task-scheduled").
|
|
414
415
|
:param task:
|
|
415
|
-
The :
|
|
416
|
+
The :class:`WoolTask` instance associated with this event.
|
|
416
417
|
"""
|
|
417
418
|
|
|
418
419
|
type: WoolTaskEventType
|
|
@@ -427,7 +428,7 @@ class WoolTaskEvent:
|
|
|
427
428
|
:param type:
|
|
428
429
|
The type of the task event.
|
|
429
430
|
:param task:
|
|
430
|
-
The :
|
|
431
|
+
The :class:`WoolTask` instance associated with the event.
|
|
431
432
|
"""
|
|
432
433
|
self.type = type
|
|
433
434
|
self.task = task
|