Skip to content

Commit 3ef251b

Browse files
committed
More fixes
1 parent d6717bc commit 3ef251b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/docs/workers/languages/python/examples.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ def to_js(obj):
9090

9191
class Default(WorkerEntrypoint):
9292
async def fetch(self, request):
93-
# Bindings are available on the 'env' parameter
93+
# Bindings are available on the 'env' attribute
9494
# https://developers.cloudflare.com/queues/
9595

9696
# The default contentType is "json"
9797
# We can also pass plain text strings
98-
await env.QUEUE.send("hello", contentType="text")
98+
await self.env.QUEUE.send("hello", contentType="text")
9999
# Send a JSON payload
100-
await env.QUEUE.send(to_js({"hello": "world"}))
100+
await self.env.QUEUE.send(to_js({"hello": "world"}))
101101

102102
# Return a response
103103
return Response.json({"write": "success"})
@@ -110,7 +110,7 @@ from workers import WorkerEntrypoint, Response
110110

111111
class Default(WorkerEntrypoint):
112112
async def fetch(self, request):
113-
results = await env.DB.prepare("PRAGMA table_list").run()
113+
results = await self.env.DB.prepare("PRAGMA table_list").run()
114114
# Return a JSON response
115115
return Response.json(results)
116116
```

0 commit comments

Comments
 (0)