-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed as not planned
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
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:
async def read_one_by_id(request: ReadOneByIdRequest) -> Content[Account]:
return rx.just(request).pipe(
ops.map(async lambda request: await account_repository.read_one_by_id(request.id)),
ops.map(lambda entity: Content(data=entity, message="Account read one by id succeed.")),
ops.catch(lambda exception, source: rx.just(
Content(entity=None, message=f"Account read one by id failed: {exception}")))
).run()Previous discussion
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-asynciotype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done