MyGit

0.5.0rc2

airtai/faststream

版本发布时间: 2024-04-09 21:08:55

airtai/faststream最新发布版本:0.5.28(2024-10-21 03:51:54)

What's Changed

This is the final API change before stable 0.5.0 release

⚠️ HAS BREAKING CHANGE

In it, we stabilize the behavior of publishers & subscribers middlewares

async def subscriber_middleware(call_next, msg):
    return await call_next(msg)

async def publisher_middleware(call_next, msg, **kwargs):
    return await call_next(msg, **kwargs)

@broker.subscriber(
    "in",
    middlewares=(subscriber_middleware,),
)
@broker.publisher(
    "out",
    middlewares=(publisher_middleware,),
)
async def handler(msg):
    return msg

Such changes allows you two features previously unavailable

Without these features we just can't impelement Observability Middleware or any similar tool, so it is the job to be done.

Now you are free to get access at any message processing stage and we are one step closer to the framework we would like to create!

Full Changelog: https://github.com/airtai/faststream/compare/0.5.0rc0...0.5.0rc2

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-04-09发行的版本