-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Adds Python version of durable objects examples #26809
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
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
d302332 to
ac3efb8
Compare
|
|
||
| async def getCounterValue(self): | ||
| value = await self.ctx.storage.get("value") | ||
| return value if value is not None else 0 |
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.
Could do:
| return value if value is not None else 0 | |
| return value or 0 |
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/durable-objects/examples/websocket-hibernation-server.mdx
Outdated
Show resolved
Hide resolved
ac3efb8 to
b0d18c3
Compare
| let currentAlarm = await this.storage.getAlarm(); | ||
| if (currentAlarm == null) { | ||
| this.storage.setAlarm(Date.now() + 1000 * SECONDS); | ||
| this.storage.setAlarm(Date.now() + 1000 * 10); |
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.
Just curious - why the seconds change?
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.
Can change it back if you disagree
Summary
Adds a new tab for Python for most of the Durable Object examples in the docs.
Test Plan