nvflare.collab.api.group_call_context module
- class GroupCallContext(app, target_name: str, call_opt: CallOption, func_name: str, process_cb, cb_kwargs, context: Context, waiter: ResultWaiter)[source]
Bases:
objectGroupCallContext contains contextual information about a group call to a target.
- Parameters:
app – the calling app.
target_name – name of the target to be called in the remote app.
call_opt – call options.
func_name – name of the function to be called in the remote app.
process_cb – the callback function to be called to process response from the remote app.
cb_kwargs – kwargs passed to the callback function.
context – call context.
waiter – the waiter to wait for result
- class ResultQueue(limit: int)[source]
Bases:
object- append(item, is_whole=True)[source]
Append an item to the result queue.
- Parameters:
item – the item to be appended.
is_whole – whether the item is whole.
Returns: whether the queue has received all whole items.
- append_failure(site_name: str, error: CollabCallError)[source]
Record a terminal failure without yielding it as a successful result.
- class ResultWaiter(sites: list[str])[source]
Bases:
Event- dec_call_count()[source]
Decrease standing call count by 1, and notify other threads waiting for call count decreased.
Returns: None
- set_failure(target_name: str, error: CollabCallError)[source]