Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Add a util to cache results from coroutines #977

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

mk-armah
Copy link
Member

@mk-armah mk-armah commented Sep 3, 2024

Description

What - Adding a function to cache results from coroutine functions

Why - The currently caching utils cache_iterator_result caches results from async generators only. If third party's want to cache results from a coroutine, they result to using the event context directly, by introducing this we improve QOL a step further and adhere to DRY.

How - The addition is basically a replica of the existing cache_iterator_result decorator, however, this is designed to accommodate coroutines by awaiting results as opposed to iterative yield with async for.

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

@mk-armah mk-armah requested a review from a team as a code owner September 3, 2024 08:09
@github-actions github-actions bot added the size/S label Sep 3, 2024
@mk-armah
Copy link
Member Author

mk-armah commented Sep 3, 2024

Functionality has been added in another PR. #974

@mk-armah mk-armah closed this Sep 3, 2024
@mk-armah mk-armah reopened this Nov 13, 2024
@github-actions github-actions bot added size/M and removed size/S labels Nov 13, 2024
@mk-armah mk-armah changed the title [Core] Add a function to cache results from coroutine functions [Core] Add a util to cache results from coroutines Nov 13, 2024
@Tankilevitch Tankilevitch reopened this Nov 13, 2024
@github-actions github-actions bot added size/L and removed size/M labels Nov 19, 2024
Copy link
Member

@matan84 matan84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matan84 matan84 merged commit f7f6d21 into main Nov 21, 2024
16 checks passed
@matan84 matan84 deleted the PORT-10244/improvement-ocean branch November 21, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants