You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/get-started.mdx
+99-5Lines changed: 99 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,9 @@ If you do not use JavaScript or TypeScript, you will need a [shim](https://devel
72
72
73
73
Your `MyDurableObject` class will have a constructor with two parameters. The first parameter, `ctx`, passed to the class constructor contains state specific to the Durable Object, including methods for accessing storage. The second parameter, `env`, contains any bindings you have associated with the Worker when you uploaded it.
@@ -83,19 +85,35 @@ export class MyDurableObject extends DurableObject<Env> {
83
85
```
84
86
</TypeScriptExample>
85
87
88
+
<TabItemlabel="Python"icon="seti:python">
89
+
90
+
```python
91
+
from workers import DurableObject
92
+
93
+
classMyDurableObject(DurableObject):
94
+
def__init__(self, ctx, env):
95
+
super().__init__(ctx, env)
96
+
```
97
+
98
+
</TabItem>
99
+
100
+
</Tabs>
101
+
86
102
Workers communicate with a Durable Object using [remote-procedure call](/workers/runtime-apis/rpc/#_top). Public methods on a Durable Object class are exposed as [RPC methods](/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/) to be called by another Worker.
0 commit comments