openfl.utilities.fed_timer.SyncAsyncTaskDecoFactory#

class openfl.utilities.fed_timer.SyncAsyncTaskDecoFactory[source]#

Bases: object

Sync and Async Task decorator factory.

This class is a factory for creating decorators for synchronous and asynchronous tasks. Task decorator factory allows creation of concrete implementation of wrapper interface and contextmanager to setup a common functionality/resources shared by async_wrapper and sync_wrapper.

is_coroutine#

Whether the decorated function is a coroutine.

Type:

bool

__init__()#

Methods

__init__()

wrapper(func, *args, **kwargs)

Create a context for the decorated function.

wrapper(func, *args, **kwargs)[source]#

Create a context for the decorated function.

Parameters:
  • func (function) – The function to be decorated.

  • args (tuple) – The positional arguments to pass to the function.

  • kwargs (dict) – The keyword arguments to pass to the function.

Yields:

None