-
Notifications
You must be signed in to change notification settings - Fork 24
Implement schedule.get
, schedule.list
, and schedule.cancel
#823
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
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Awesome, I'll check this out later today |
Open in Stackblitz • chat-room • counter @actor-core/framework-base
@actor-core/cloudflare-workers
commit: |
c3c3482
to
acb5b01
Compare
} | ||
} | ||
|
||
return Object.freeze(alarms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Object.freeze
here and above is just to ensure the alarm data structure can't be mutated. Probably should do the same for .get
@@ -7,6 +7,7 @@ export interface ActorDriverContext { | |||
|
|||
export class RivetActorDriver implements ActorDriver { | |||
#ctx: ActorContext; | |||
#alarm: { timeout: ReturnType<typeof setTimeout>; timestamp: number } | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not completely clear to me if the rivet driver is instantiated once per actor like the cloudflare driver is once per durable object. I've implemented this assuming that it is.
ce83f2e
to
7d4142f
Compare
Given the recent updates to the internal API, I've gutted this PR and just left the interface and docs. I'll go back through and re-implement it. |
c8d38ec
to
7300819
Compare
7300819
to
cf81243
Compare
98d74da
to
640e24e
Compare
640e24e
to
1c3afbd
Compare
Fixes #805
Adds a basic implementation of
getAlarm
anddeleteAlarm
to all the existing drivers. To schedule I've addedget
,cancel
, andlist
methods as well as updating the return type ofafter
and `at.I've avoided doing anything exotic with the drivers. I've mainly just tried to keep it as simple as I can. I chose to keep the alarm state at the driver level because it does feel like it's a bit unique to the driver.
This could still use some tests overall. I'd like some feedback before going further.