WattsonAsyncResponse#
- class wattson.cosimulation.control.messages.wattson_async_response.WattsonAsyncResponse(reference_id: int = -1)#
Bases:
WattsonResponse
Methods
copy_for_sending
is_promise
is_successful
resolve
Calls the given function (resolve_task) in a new thread to allow for asynchronous resolution.
set_successful
- __init__(reference_id: int = -1)#
- resolve_with_task(resolve_task: Callable[[WattsonAsyncResponse, Dict], WattsonResponse], further_kwargs: Dict | None = None)#
Calls the given function (resolve_task) in a new thread to allow for asynchronous resolution. After the resolve_task finishes and returns a WattsonResponse, this WattsonAsyncResponse is automatically resolved.
- Parameters:
resolve_task (Callable[['WattsonAsyncResponse', Dict], WattsonResponse]) – The callable to call for deriving the full WattsonResponse
further_kwargs (Optional[Dict], optional) – A dict with further arguments to pass to the resolve_task function (as a dict!). If None is given, an empty dict is created. (Default value = None)