yrb-lite-actioncable 0.1.0.beta1 → 0.1.0.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff73c1e1f2a6eba76885f3dc424b6dd6a270a996bdaf90ad4d27a4f0bdac4b70
4
- data.tar.gz: e24b4854df8b61d32f4aab79988dbfe5c4aaa82dd0bf7aec1498db490cf2c2fa
3
+ metadata.gz: 27413345a88f1b9cd8ca4cdd4455ef42c4438ebe98493a8ba4a1a059b5da948a
4
+ data.tar.gz: fb6f7072aa9e8eb1fa4271fabc77cbe4620871718f3d3d49bcaa32ec857daba7
5
5
  SHA512:
6
- metadata.gz: 9856087504c7d4ed245a424f8c4cd8f11b4d8cfba0f485ca2c14b5db988ece95d49753c0d0bb81fc5d0f8876c00b946b78a45ebe81a28da56863a789a552afd5
7
- data.tar.gz: 076a78ddd1777657a93060d6221424b1a5fd1c785fafa25b65262b16b5046200d49c2feeec5c5031be7b4232435836fe993aefb0c13ae36c762cc88d5f92f166
6
+ metadata.gz: aea2006f44c6d26728c3e59452f44e8f1f2f62ccb06c26a8b7e83ddbfc4c50c96f951b462de95409501140be572881e91b83a1a424de7b01f8513af8f8985784
7
+ data.tar.gz: b28ffe8e6ee5648d9c4f492d7cd7e2151e4d6055a2f400c5cdc7d8b5c13b6ee4052c3fbb036aa683b7019603729917930f5f6fd9afc17edc92caf32784bd9dd2
@@ -6,6 +6,18 @@ this project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0.beta2] - 2026-06-20
10
+
11
+ ### Added
12
+
13
+ - Automatic AnyCable whispering for awareness/presence. When running under
14
+ AnyCable, the channel now enables client-to-client whispering on its stream
15
+ (`stream_from key, whisper: true`), so a client that whispers awareness has its
16
+ presence frames broadcast directly to other subscribers with no server
17
+ round-trip. It's automatic -- no configuration -- and a no-op on plain
18
+ ActionCable (no whisper support), where presence stays server-relayed. Document
19
+ updates are never whispered.
20
+
9
21
  ## [0.1.0.beta1] - 2026-06-18
10
22
 
11
23
  ### Added
@@ -23,4 +35,5 @@ this project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0
23
35
  directly.
24
36
 
25
37
  [Unreleased]: https://github.com/jpcamara/yrb-lite/commits/main
38
+ [0.1.0.beta2]: https://github.com/jpcamara/yrb-lite/commits/main
26
39
  [0.1.0.beta1]: https://github.com/jpcamara/yrb-lite/releases/tag/v0.1.0.beta5
@@ -121,7 +121,7 @@ module YrbLite::ActionCable # rubocop:disable Style/ClassAndModuleChildren
121
121
  Sync.subscribe(@sync_key)
122
122
  awareness = sync_awareness
123
123
 
124
- stream_from sync_stream_name, coder: ActiveSupport::JSON do |payload|
124
+ sync_stream sync_stream_name, coder: ActiveSupport::JSON do |payload|
125
125
  sync_on_broadcast(payload)
126
126
  end
127
127
 
@@ -399,10 +399,21 @@ module YrbLite::ActionCable # rubocop:disable Style/ClassAndModuleChildren
399
399
  # outside Ruby) relays them directly. Send the opening SyncStep1 built from
400
400
  # the durable store. No warm replica is kept.
401
401
  def sync_for_store_backed
402
- stream_from sync_stream_name
402
+ sync_stream sync_stream_name
403
403
  sync_transmit(sync_load_doc.sync_step1)
404
404
  end
405
405
 
406
+ # Subscribe to the document's broadcast stream. Under AnyCable (which adds a
407
+ # `whispers_to` method) this also enables client-to-client whispering on the
408
+ # stream, so a client that whispers awareness (any AnyCable consumer can)
409
+ # reaches other subscribers with no server round-trip. On plain ActionCable
410
+ # the option is omitted -- there's no whisper support -- so presence is
411
+ # server-relayed. It's automatic either way; nothing to configure.
412
+ def sync_stream(name, **opts, &)
413
+ opts[:whisper] = true if respond_to?(:whispers_to)
414
+ stream_from(name, **opts, &)
415
+ end
416
+
406
417
  # Stateless per message: no warm replica, no assumptions about which process
407
418
  # owns a document. A client's SyncStep1 is answered from the store, document
408
419
  # changes are recorded durably before relay and then broadcast, and
@@ -2,6 +2,6 @@
2
2
 
3
3
  module YrbLite
4
4
  module ActionCable
5
- VERSION = "0.1.0.beta1"
5
+ VERSION = "0.1.0.beta2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yrb-lite-actioncable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta1
4
+ version: 0.1.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Camara