Closed llucax closed 6 months ago
Based on #48.
Updated. Will fix up before merging.
Updated.
Enabled auto-merge.
The good news is the merge queue checks now works correctly, the bad news is I forgot 2 fixes need to be applied to fix the CI, so this PR depends now on this PR to be merged:
Rebased, it needs a new approval.
With this change
GrpcStreamBroadcaster
can be used with bothgrpcio
andgrpclib
implementations of gRPC.This is achieved by using
AsyncIterator
instead ofgrpc.aio.UnaryStreamCall
in thestream_method
parameter ofGrpcStreamBroadcaster
to make it more generic, and catching exceptions from bothgrpcio
andgrpclib
in theasync for
loop.To deal with any of the libraries being installed, a new module is added to handles exceptions from both libraries, by conditionally importing the exception and provide a dummy one if the library is not installed.
Now both
grpcio
andgrpclib
are optional, and can be installed usingfrequenz-client-base[grpcio]
orfrequenz-client-base[grpclib]
respectively.We also add some tests for
GrpcStreamBroadcaster
.