Giter VIP home page Giter VIP logo

runnel's People

Contributors

mjwestcott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

runnel's Issues

Current Status?

Hi. Having a lightweight alternative for Kafka/Faust is awesome, a shame this hasn't got more attention up until now, thanks for sharing!
Wondering what's the current status of the project. Experiences in production? Still being maintained?

Thanks!

KeyError: 'RUNNEL_TESTING'

Running simple example for middlewares:

from datetime import datetime

from runnel import App, Record, Events, Middleware

app = App(name="myapp", redis_url="redis://127.0.0.1")


class Order(Record):
    order_id: int
    created_at: datetime
    amount: int


class Printer(Middleware):
    async def handler(self, parent: Events, **kwargs):
        async for x in parent:
            print(x)
            yield x


orders = app.stream("orders", record=Order, partition_by="order_id")


@app.processor(orders, middleware=[Printer()])
async def printer(events: Events):
    async for order in events.records():
        pass

error stack

Traceback (most recent call last):
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/runnel/runner.py", line 157, in consumer
    await tg.cancel_scope.cancel()
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 438, in __aexit__
    raise exceptions[0]
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 466, in _run_wrapped_task
    await func(*args)
  File "/Users/colch/Work/py-word-counter/app.py", line 26, in printer
    async for order in events.records():
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/runnel/events.py", line 175, in iter
    async for x in agen:
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/runnel/middleware/deserialize.py", line 11, in handler
    async for x in parent:
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/runnel/middleware/ack.py", line 11, in handler
    async for x in parent:
  File "/Users/colch/Work/py-word-counter/app.py", line 17, in handler
    print(x)
  File "/Users/colch/Work/py-word-counter/.venv/lib/python3.9/site-packages/runnel/types.py", line 82, in __repr__
    if os.environ["RUNNEL_TESTING"] == "1":
  File "/usr/local/Cellar/[email protected]/3.9.1_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'RUNNEL_TESTING'

Exporting env variable RUNNEL_TESTING fixes this, indeed. But I suppose, os.environ["RUNNEL_TESTING"] should be os.environ.get("RUNNEL_TESTING"), right?

Integrating a key:value storage and lock within processor functions

Hi,

thank you for developing runnel!

I would like to add a simple redis key/value store functionality to be used within processor functions whereas (for performance purposes) the already open runnel redis connection should be used. Also, a lock mechanism for write procedures should be in place. Any hints on how to get this done?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.