Skip to content

Pubsub#69

Open
yisraelU wants to merge 10 commits into
mainfrom
pubsub
Open

Pubsub#69
yisraelU wants to merge 10 commits into
mainfrom
pubsub

Conversation

@yisraelU

Copy link
Copy Markdown
Collaborator

No description provided.

Yisrael Union and others added 10 commits May 26, 2026 00:06
Covers fs2 Stream-based message delivery, ValkeyPubSub algebra,
Glide queue-mode polling architecture, and shared subscription
state management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ValkeyChannel, ValkeyPattern opaque types and ValkeyPatternEvent
- Add PubSubStats, PublishCommands, SubscribeCommands, ValkeyPubSub traits
- Add PubSubState for managing channel/pattern subscription state with Topic-based fan-out

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…oint

- Fix publish return type from F[Long] to F[Unit] (Glide returns "OK")
- Add MessageDispatcher: polls getPubSubMessage in a loop, dispatches to
  channel/pattern subscribers via Topic, with error recovery
- Add LiveValkeyPubSub: full implementation of ValkeyPubSub trait with
  ref-counted subscriptions, automatic cleanup on last unsubscribe
- Add ValkeyPubSub companion with make/utf8 factory methods that start
  a background poll fiber managed by Resource

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… multi-subscriber

Implements Tasks 8, 9, and 10 of the pub/sub feature plan:
- Basic subscribe/publish flow (3 tests)
- Pattern subscriptions (psubscribe/punsubscribe, 3 tests)
- Multi-subscriber scenarios and cleanup (3 tests)

Key test patterns:
- Use Stream.sleep before publishing to allow subscription registration
- Wrap IO results in Stream.eval for concurrently
- ValkeyPatternEvent has plain K fields, not wrapped types
- Tests compile but require running Valkey container to execute

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…terns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive load/stress testing for pub/sub:
- High throughput: 10,000 messages on single channel
- Many channels: 100 concurrent channel subscriptions
- Many subscribers: 50 subscribers on one channel
- Rapid subscribe/unsubscribe: 50 cycles
- Sustained publish rate: 1,000 msg/sec for 5 seconds

All tests verify message ordering and completeness under load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- fromCertFile[F]: load PEM from disk path (blocking via Sync)
- fromCertString: parse PEM from String

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pattern is now ValkeyPattern[K], channel is ValkeyChannel[K] — enforces
type safety through the event boundary rather than exposing raw K.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant