Skip to content

Use wasmsockets package - #52

Closed
dom96 wants to merge 3 commits into
mainfrom
dominik/websocket-stream-consumer-wasmsockets
Closed

Use wasmsockets package#52
dom96 wants to merge 3 commits into
mainfrom
dominik/websocket-stream-consumer-wasmsockets

Conversation

@dom96

@dom96 dom96 commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Same as #51 but uses the wasmsockets package. I think showing both is useful (and this one found bugs so it's worth keeping).

@dom96
dom96 force-pushed the dominik/websocket-stream-consumer branch 4 times, most recently from 04bd250 to 984758d Compare November 25, 2025 17:41
Base automatically changed from dominik/websocket-stream-consumer to main November 25, 2025 19:16
@dom96
dom96 force-pushed the dominik/websocket-stream-consumer-wasmsockets branch from 13b46c8 to bb1b8ca Compare August 20, 2026 13:44
@dom96
dom96 force-pushed the dominik/websocket-stream-consumer-wasmsockets branch from bb1b8ca to ff63e2f Compare August 20, 2026 13:48
@dom96
dom96 marked this pull request as ready for review August 20, 2026 13:50
@dom96
dom96 requested review from hoodmane and ryanking13 August 20, 2026 13:51

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please updated the example number? I just merged my django example with 18, 19.

Also, please update README.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess we didn't want to include uv.lock (and probably pylock.toml too), so that users can always pick up the latest package versions. Maybe we should include them to .gitignore.

"name": "BLUESKY_FIREHOSE",
"class_name": "BlueskyFirehoseConsumer"
"class_name": "BlueskyFirehoseConsumer",
"script_name": "python-websocket-stream-consumer-313-old-date"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess the script_name is not needed?

dependencies = []
dependencies = [
"webtypy>=0.1.7",
"wasmsockets @ git+https://github.com/dom96/wasmsockets.git@main",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this work at all? I am not sure if pywrangler currently support git urls.

@dom96 dom96 Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ahh, remembering why I had to fork it. Meh. Maybe leaving existing websocket example that we have as-is is fine then. I prefer it over the wasmsockets usage.

requires-python = ">=3.12"
dependencies = []
dependencies = [
"webtypy>=0.1.7",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"webtypy>=0.1.7",


This example demonstrates a long-running Durable Object that connects to the Bluesky firehose (via Jetstream) and filters for post events, with rate limiting to print at most 1 per second.

This is the same as 14-websocket-stream-consumer, but it uses the wasmsockets package for WebSocket connections.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we should update that example instead of adding a new one (the names are pretty similar as well).

@dom96

dom96 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

On second thought, we probably don't want to use this package for our leading example here. So closing.

@dom96 dom96 closed this Aug 21, 2026
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.

2 participants