gloe.gateways

gloe.gateways.parallel(*transformers)[source]

Currently, the parallelism of transformers is supported only by executing async transformers concurrently.

Parameters:

*transformers (Sequence[Transformer | AsyncTransformer]) – the list of transformers what will receive the same input.

Returns:

Union[Transformer, AsyncTransformer]

a transformer that will execute all the

transformers in parallel and return a tuple with the results. If at least one of the transformers passed is an AsyncTransformer, the returned transformer is also an AsyncTransformer. Otherwise, the returned transformer is sync.

Return type:

Transformer | AsyncTransformer

gloe.gateways.sequential(*transformers)[source]

Execute the transformers one after the other, even the async transformers.

Parameters:

*transformers (Sequence[Transformer | AsyncTransformer]) – the list of transformers what will receive the same input.

Returns:

Union[Transformer, AsyncTransformer]

a transformer that will execute all the

transformers in parallel and return a tuple with the results. If at least one of the transformers passed is an AsyncTransformer, the returned transformer is also an AsyncTransformer. Otherwise, the returned transformer is sync.

Return type:

Transformer | AsyncTransformer