pulsar-client-python icon indicating copy to clipboard operation
pulsar-client-python copied to clipboard

Implementation of the asyncio consumer

Open Nictec opened this issue 1 year ago • 6 comments
trafficstars

Hi, I implemented the asyncio consumer in a similar way as the producer. All missing async functions provided by the C++ library are now implemented in the pybind11 classes and I use futures in python to convert the functions with callbacks to async functions. The reason I started with this implementation is because I need the async consumer in a project with FastAPI myself. Tests could be a little bit patchy, for that reason i would appreciate help if i missed something

Nictec avatar Sep 20 '24 08:09 Nictec

Traceback (most recent call last):
  File "asyncio_test.py", line 27, in <module>
    from pulsar.asyncio import (
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pulsar/asyncio.py", line 165, in <module>
    class Consumer:
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pulsar/asyncio.py", line 216, in Consumer
    async def seek(self, position: tuple[int, int, int, int] | pulsar.MessageId):
TypeError: 'type' object is not subscriptable

Could you also make the tests pass for Python 3.8? Though Python 3.8 will reach EOL on the next month (2024-10)

BewareMyPower avatar Sep 27 '24 11:09 BewareMyPower

I will try to fix the issues this week.

Nictec avatar Sep 30 '24 07:09 Nictec

I found another issue with the schema system in my asyncio implementation, i will fix this too before the next commit.

Nictec avatar Oct 18 '24 11:10 Nictec

Let me fix the broken CI first

BewareMyPower avatar Oct 30 '24 08:10 BewareMyPower

Could you rebase to master to resolve the conflicts and have the CI fixed?

BewareMyPower avatar Nov 01 '24 01:11 BewareMyPower

@BewareMyPower I removed the binary files

merlimat avatar Dec 02 '24 16:12 merlimat