@@ -110,6 +110,8 @@ def Dispatch(self, request: dispatch_pb.DispatchRequest, context):
110
110
run_request = function_pb .RunRequest (
111
111
function = call .function ,
112
112
input = call .input ,
113
+ dispatch_id = dispatch_id ,
114
+ root_dispatch_id = dispatch_id ,
113
115
)
114
116
self .queue .append ((dispatch_id , run_request , CallType .CALL ))
115
117
@@ -207,6 +209,8 @@ def dispatch_calls(self):
207
209
assert dispatch_id not in self .pollers
208
210
poller = Poller (
209
211
id = dispatch_id ,
212
+ parent_id = request .parent_dispatch_id ,
213
+ root_id = request .root_dispatch_id ,
210
214
function = request .function ,
211
215
coroutine_state = response .poll .coroutine_state ,
212
216
waiting = {},
@@ -219,6 +223,9 @@ def dispatch_calls(self):
219
223
child_request = function_pb .RunRequest (
220
224
function = call .function ,
221
225
input = call .input ,
226
+ dispatch_id = child_dispatch_id ,
227
+ parent_dispatch_id = request .dispatch_id ,
228
+ root_dispatch_id = request .root_dispatch_id ,
222
229
)
223
230
224
231
_next_queue .append (
@@ -239,6 +246,9 @@ def dispatch_calls(self):
239
246
tail_call_request = function_pb .RunRequest (
240
247
function = tail_call .function ,
241
248
input = tail_call .input ,
249
+ dispatch_id = request .dispatch_id ,
250
+ parent_dispatch_id = request .parent_dispatch_id ,
251
+ root_dispatch_id = request .root_dispatch_id ,
242
252
)
243
253
_next_queue .append ((dispatch_id , tail_call_request , CallType .CALL ))
244
254
@@ -269,6 +279,9 @@ def dispatch_calls(self):
269
279
len (poller .results ),
270
280
)
271
281
poll_results_request = function_pb .RunRequest (
282
+ dispatch_id = poller .id ,
283
+ parent_dispatch_id = poller .parent_id ,
284
+ root_dispatch_id = poller .root_id ,
272
285
function = poller .function ,
273
286
poll_result = poll_pb .PollResult (
274
287
coroutine_state = poller .coroutine_state ,
@@ -349,6 +362,9 @@ def __exit__(self, exc_type, exc_val, exc_tb):
349
362
@dataclass
350
363
class Poller :
351
364
id : DispatchID
365
+ parent_id : DispatchID
366
+ root_id : DispatchID
367
+
352
368
function : str
353
369
354
370
coroutine_state : bytes
0 commit comments