You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for async/await in the lambda expression. #101871
Need support for async/await in the lambda expression.
Pitch
I found meaningful use cases for async lambda in reactive programming. Here is the example code that should be:
asyncdefread_one_by_id(request: ReadOneByIdRequest) ->Content[Account]:
returnrx.just(request).pipe(
ops.map(asynclambdarequest: awaitaccount_repository.read_one_by_id(request.id)),
ops.map(lambdaentity: Content(data=entity, message="Account read one by id succeed.")),
ops.catch(lambdaexception, source: rx.just(
Content(entity=None, message=f"Account read one by id failed: {exception}")))
).run()
Activity
kumaraditya303 commentedon Feb 13, 2023
Please discuss this first on https://discuss.python.org/c/ideas/6 and FYI this will need a PEP.