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

Task: Implement the resume event for tasks. #140

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

avillega
Copy link
Contributor

No description provided.

@avillega avillega requested a review from dfarr August 16, 2024 22:51
@avillega
Copy link
Contributor Author

Creating a Draft PR for now, the biggest outstanding work is to listen at the right recv() endpoint. Currently the task source server is listening in all interfaces but the recv sent to the server when creating a callback is always a localhost

}

private async handleTask(task: TaskMessage): Promise<void> {
const resumeBody = await this.#resonate.store.tasks.claim(task.id, task.counter);
Copy link
Member

Choose a reason for hiding this comment

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

I think we need a fast exit here in the case where we fail to claim the task. Does the store throw in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the store throws in this case, I will hande this case.

@avillega avillega force-pushed the avillega/resume-callbacks branch 2 times, most recently from 8a97b4d to 313eca5 Compare August 27, 2024 00:32
This commits include most of the initial implementation
for the task framework. At the time of this commit, only
the Resume event is being handled.
@avillega avillega force-pushed the avillega/resume-callbacks branch from b2b6c3e to 318d600 Compare September 3, 2024 23:33
The current sleep tests had timeouts set too short, given the
server <-> client latencies and the different processing times
both at the server and client it was needed to increase the timeouts
and sleep times. This caused the tests to take way too long, by merging
all the test calls in a single one and awaiting only a "promise.all"
it was possible to speed it up.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 89.07285% with 33 lines in your changes missing coverage. Please review.

Project coverage is 82.99%. Comparing base (57af298) to head (7a796c8).

Files with missing lines Patch % Lines
lib/core/tasksSources/http.ts 85.48% 9 Missing ⚠️
lib/core/tasks.ts 90.36% 8 Missing ⚠️
lib/core/stores/remote.ts 83.33% 6 Missing ⚠️
lib/core/stores/local.ts 88.09% 5 Missing ⚠️
lib/core/tasksSources/local.ts 90.90% 3 Missing ⚠️
lib/resonate.ts 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #140      +/-   ##
==========================================
+ Coverage   81.09%   82.99%   +1.89%     
==========================================
  Files          17       21       +4     
  Lines        1095     1382     +287     
  Branches      290      364      +74     
==========================================
+ Hits          888     1147     +259     
- Misses        207      235      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 this pull request may close these issues.

3 participants