MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / async_call

Function async_call

tensorboard/util/grpc_util.py:143–155  ·  view source on GitHub ↗

Invokes the gRPC future and orchestrates it via the AsyncCallFuture.

(handler)

Source from the content-addressed store, hash-verified

141 async_future = AsyncCallFuture(completion_event)
142
143 def async_call(handler):
144 """Invokes the gRPC future and orchestrates it via the AsyncCallFuture."""
145 future = api_method.future(
146 request,
147 timeout=_GRPC_DEFAULT_TIMEOUT_SECS,
148 metadata=version_metadata(),
149 )
150 # Ensure we set the active future before invoking the done callback, to
151 # avoid the case where the done callback completes immediately and
152 # triggers completion event while async_future still holds the old
153 # future.
154 async_future._set_active_future(future)
155 future.add_done_callback(handler)
156
157 # retry_handler is the continuation of the `async_call`. It should:
158 # * If the grpc call succeeds: trigger the `completion_event`.

Callers 2

retry_handlerFunction · 0.85
async_call_with_retriesFunction · 0.85

Calls 2

version_metadataFunction · 0.85
_set_active_futureMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…