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

Context for Receipts and Manager methods #240

Open
gusinacio opened this issue Aug 16, 2024 · 0 comments · May be fixed by #241
Open

Context for Receipts and Manager methods #240

gusinacio opened this issue Aug 16, 2024 · 0 comments · May be fixed by #241

Comments

@gusinacio
Copy link
Collaborator

There are multiple tests and even tap-manager methods that could benefit from having a context tied to that specific action.

For example, while we create a RAV request, we could have a transaction that could make all the actions atomic and in case anything fails, for example, one retryable check or even the RPC call to tap-aggregator, we could revert everything at once.

Another example is for checks that depends on information injected on other part of the code. Checks don't contain any other information other than receipt and we need a type of cache that adds more information to an specific receipt. With a context, we could add more receipt information to be used inside the checks.

Context should be used like Axum where we can inject into the "request" (receipt) or more broadly over the whole lifetime of the program (with_data() in axum's example).

This also solves a problem of having multiple Arc<Mutex<>>es and multiple copies of sqlx::Pool in all checks.

@gusinacio gusinacio linked a pull request Sep 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant