anycable-core 1.5.2 โ†’ 1.6.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 471f65d8e5181aad39ec9b4ed537b6b7721ce39aef220a450089106cdad55944
4
- data.tar.gz: fd511a291e8931d324fed2c9e3847de18e4815fc2ffecd86d5736f19b8b73855
3
+ metadata.gz: 5a1e141540dbc11a56633dda1ba555de70900a37e3510f2c6404e50cc1375cfc
4
+ data.tar.gz: f51a96aa3b101fbd9a3dbfa66ec51109b3ff81897796a9e9a8d3fa2ba29ef0eb
5
5
  SHA512:
6
- metadata.gz: 9fac18169b44904b6cef45881a95d3e0e0e99e8410dc244847a3a72511390d6f09c90ce4702201eed440e5d1c7403032dee2bee652878b8398e6351081e11ab2
7
- data.tar.gz: 5861b7974c45f5c84e8a29a95fd9684e7b660bb7ce14596289a67b3b9784c777001179f1adfff85f9105ad4b93c7cce26ef04c0b310962cd904a4903d927a465
6
+ metadata.gz: 9d021b6d6036e6d6d425ead93557688cb99d119f36276acae4474abb12b0aa58ada3bd380c48d8d154978449299dd23bb36e629a148be5b5a62831b51049c6ec
7
+ data.tar.gz: 7bd8f7d0abc547f8b61bab521d8ff96f4d58a5e5887982f597c7e71472bd8abb9179611bb28c29e236f5f4a89ac6c6f8f0a91f540b44f13785e4dcc8ccf8032f
data/CHANGELOG.md CHANGED
@@ -213,7 +213,7 @@ See [#71](https://github.com/anycable/anycable/pull/71).
213
213
 
214
214
  ---
215
215
 
216
- See [Changelog](https://github.com/anycable/anycable/blob/0-6-stable/CHANGELOG.md) for versions <1.0.0.
216
+ See [Changelog](https://github.com/anycable/anycable-rb/blob/0-6-stable/CHANGELOG.md) for versions <1.0.0.
217
217
 
218
218
  [@palkan]: https://github.com/palkan
219
219
  [@smasry]: https://github.com/smasry
data/README.md CHANGED
@@ -1,77 +1,29 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/anycable.svg)](https://rubygems.org/gems/anycable)
2
- [![Build](https://github.com/anycable/anycable/workflows/Build/badge.svg)](https://github.com/anycable/anycable/actions)
3
- [![Coverage Status](https://coveralls.io/repos/github/anycable/anycable/badge.svg?branch=master)](https://coveralls.io/github/anycable/anycable?branch=master)
4
- [![Documentation](https://img.shields.io/badge/docs-link-brightgreen.svg)](https://docs.anycable.io/v1)
2
+ [![Build](https://github.com/anycable/anycable-rb/workflows/Build/badge.svg)](https://github.com/anycable/anycable-rb/actions)
3
+ [![Documentation](https://img.shields.io/badge/docs-link-brightgreen.svg)](https://docs.anycable.io)
5
4
 
6
- # AnyCable
5
+ # AnyCable Ruby SDK
7
6
 
8
7
  <img align="right" height="150" width="129"
9
8
  title="AnyCable logo" src="https://docs.anycable.io/assets/images/logo.svg">
10
9
 
11
- AnyCable allows you to use any WebSocket server (written in any language) as a replacement for your Ruby server (such as Faye, Action Cable, etc).
10
+ [AnyCable](https://anycable.io) is an open-source language-agnostic realtime server for reliable two-way communication. This repository contains the Ruby SDK for AnyCable including RPC server implementations, broadcasting adapters and other utilities that could help you to integrate AnyCable into any Ruby application. For Rails integration, check out a dedicated gem: [anycable-rails](https://github.com/anycable/anycable-rails).
12
11
 
13
- AnyCable uses the same protocol as ActionCable, so you can use its [JavaScript client](https://www.npmjs.com/package/actioncable) without any monkey-patching.
14
-
15
- > [AnyCable Pro](https://docs.anycable.io/pro) has been launched ๐Ÿš€
16
-
17
- <a href="https://evilmartians.com/">
18
- <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>
12
+ ๐ŸŒ [Website](https://anycable.io) ยท ๐Ÿ“š [Documentation](https://docs.anycable.io/ruby/non_rails)
19
13
 
20
14
  ## Requirements
21
15
 
22
- - Ruby >= 2.7
23
- - Redis or NATS (for broadcasting **in production**, [discuss other options](https://github.com/anycable/anycable/issues/2) with us!)
24
-
25
- ## Usage
16
+ - Ruby 3.0+.
26
17
 
27
- Check out our ๐Ÿ“‘ [Documentation](https://docs.anycable.io/v1).
28
-
29
- ## Links
18
+ ## Resources
30
19
 
31
20
  - [AnyCable off Rails: connecting Twilio streams with Hanami](https://evilmartians.com/chronicles/anycable-goes-off-rails-connecting-twilio-streams-with-hanami)
32
21
 
33
- - [AnyCable 1.0: Four years of real-time web with Ruby and Go](https://evilmartians.com/chronicles/anycable-1-0-four-years-of-real-time-web-with-ruby-and-go)
34
-
35
- - [AnyCable: Action Cable on steroids!](https://evilmartians.com/chronicles/anycable-actioncable-on-steroids)
36
-
37
- - [Connecting LiteCable to Hanami](http://gabrielmalakias.com.br/ruby/hanami/iot/2017/05/26/websockets-connecting-litecable-to-hanami.html) by [@GabrielMalakias](https://github.com/GabrielMalakias)
38
-
39
- - [From Action to Any](https://medium.com/@leshchuk/from-action-to-any-1e8d863dd4cf) by [@alekseyl](https://github.com/alekseyl)
40
-
41
- ## Talks
42
-
43
- - High-speed cables for Ruby, RubyConf 2018, [slides](https://speakerdeck.com/palkan/rubyconf-2018-high-speed-cables-for-ruby) and [video](https://www.youtube.com/watch?v=8XRcOZXOzV4) (EN)
44
-
45
- - One cable to rule them all, RubyKaigi 2018, [slides](https://speakerdeck.com/palkan/rubykaigi-2018-anycable-one-cable-to-rule-them-all) and [video](https://www.youtube.com/watch?v=jXCPuNICT8s) (EN)
46
-
47
- - Wroc_Love.rb 2018 [slides](https://speakerdeck.com/palkan/wroc-love-dot-rb-2018-cables-cables-cables) and [video](https://www.youtube.com/watch?v=AUxFFOehiy0) (EN)
48
-
49
- - RubyConfMY 2017 [slides](https://speakerdeck.com/palkan/rubyconf-malaysia-2017-anycable) and [video](https://www.youtube.com/watch?v=j5oFx525zNw) (EN)
50
-
51
- - RailsClub Moscow 2016 [slides](https://speakerdeck.com/palkan/railsclub-moscow-2016-anycable) and [video](https://www.youtube.com/watch?v=-k7GQKuBevY&list=PLiWUIs1hSNeOXZhotgDX7Y7qBsr24cu7o&index=4) (RU)
52
-
53
- ## Building
54
-
55
- ### Generating gRPC files from `.proto`
56
-
57
- - Install required GRPC gems:
58
-
59
- ```sh
60
- gem install grpc
61
- gem install grpc-tools
62
- ```
63
-
64
- - Re-generate GRPC files (if necessary):
65
-
66
- ```sh
67
- make
68
- ```
69
-
70
22
  ## Contributing
71
23
 
72
- Bug reports and pull requests are welcome on GitHub at [https://github.com/anycable/anycable](https://github.com/anycable/anycable).
24
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/anycable/anycable-rb](https://github.com/anycable/anycable-rb).
73
25
 
74
- Please, provide reproduction script (using [this template](https://github.com/anycable/anycable/blob/master/etc/bug_report_template.rb)) when submitting bugs if possible.
26
+ Please, provide reproduction script (using [this template](https://github.com/anycable/anycable-rb/blob/master/etc/bug_report_template.rb)) when submitting bugs if possible.
75
27
 
76
28
  ## License
77
29
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Generated by the protocol buffer compiler. DO NOT EDIT!
4
- # Source: rpc.proto for package 'anycable'
4
+ # Source: rpc.proto for package 'AnyCable'
5
5
 
6
6
  require "grpc"
7
7
 
@@ -46,6 +46,7 @@ module AnyCable
46
46
 
47
47
  @tls_credentials = options.delete(:tls_credentials)
48
48
  @grpc_server = build_server(**options)
49
+ @sock = nil
49
50
  end
50
51
 
51
52
  # Start gRPC server in background and
@@ -63,6 +64,8 @@ module AnyCable
63
64
 
64
65
  @start_thread = Thread.new do
65
66
  loop do
67
+ break unless @sock
68
+
66
69
  conn = @sock.accept
67
70
  server.run(conn)
68
71
  rescue IOError
@@ -118,6 +121,8 @@ module AnyCable
118
121
  grpc_server.graceful_shutdown
119
122
  sock.close
120
123
 
124
+ @sock = nil
125
+
121
126
  logger.info "RPC server stopped"
122
127
  end
123
128
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  require "google/protobuf"
7
7
 
8
- descriptor_data = "\n\trpc.proto\x12\x08\x61nycable\"\xa3\x02\n\x03\x45nv\x12\x0b\n\x03url\x18\x01 \x01(\t\x12+\n\x07headers\x18\x02 \x03(\x0b\x32\x1a.anycable.Env.HeadersEntry\x12)\n\x06\x63state\x18\x03 \x03(\x0b\x32\x19.anycable.Env.CstateEntry\x12)\n\x06istate\x18\x04 \x03(\x0b\x32\x19.anycable.Env.IstateEntry\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0b\x43stateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bIstateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd1\x01\n\x0b\x45nvResponse\x12\x31\n\x06\x63state\x18\x01 \x03(\x0b\x32!.anycable.EnvResponse.CstateEntry\x12\x31\n\x06istate\x18\x02 \x03(\x0b\x32!.anycable.EnvResponse.IstateEntry\x1a-\n\x0b\x43stateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bIstateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"/\n\x11\x43onnectionRequest\x12\x1a\n\x03\x65nv\x18\x03 \x01(\x0b\x32\r.anycable.Env\"\x99\x01\n\x12\x43onnectionResponse\x12 \n\x06status\x18\x01 \x01(\x0e\x32\x10.anycable.Status\x12\x13\n\x0bidentifiers\x18\x02 \x01(\t\x12\x15\n\rtransmissions\x18\x03 \x03(\t\x12\x11\n\terror_msg\x18\x04 \x01(\t\x12\"\n\x03\x65nv\x18\x05 \x01(\x0b\x32\x15.anycable.EnvResponse\"\x7f\n\x0e\x43ommandMessage\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x01(\t\x12\x1e\n\x16\x63onnection_identifiers\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x1a\n\x03\x65nv\x18\x05 \x01(\x0b\x32\r.anycable.Env\"\xd5\x01\n\x0f\x43ommandResponse\x12 \n\x06status\x18\x01 \x01(\x0e\x32\x10.anycable.Status\x12\x12\n\ndisconnect\x18\x02 \x01(\x08\x12\x14\n\x0cstop_streams\x18\x03 \x01(\x08\x12\x0f\n\x07streams\x18\x04 \x03(\t\x12\x15\n\rtransmissions\x18\x05 \x03(\t\x12\x11\n\terror_msg\x18\x06 \x01(\t\x12\"\n\x03\x65nv\x18\x07 \x01(\x0b\x32\x15.anycable.EnvResponse\x12\x17\n\x0fstopped_streams\x18\x08 \x03(\t\"[\n\x11\x44isconnectRequest\x12\x13\n\x0bidentifiers\x18\x01 \x01(\t\x12\x15\n\rsubscriptions\x18\x02 \x03(\t\x12\x1a\n\x03\x65nv\x18\x05 \x01(\x0b\x32\r.anycable.Env\"I\n\x12\x44isconnectResponse\x12 \n\x06status\x18\x01 \x01(\x0e\x32\x10.anycable.Status\x12\x11\n\terror_msg\x18\x02 \x01(\t*-\n\x06Status\x12\t\n\x05\x45RROR\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x0b\n\x07\x46\x41ILURE\x10\x02\x32\xda\x01\n\x03RPC\x12\x46\n\x07\x43onnect\x12\x1b.anycable.ConnectionRequest\x1a\x1c.anycable.ConnectionResponse\"\x00\x12@\n\x07\x43ommand\x12\x18.anycable.CommandMessage\x1a\x19.anycable.CommandResponse\"\x00\x12I\n\nDisconnect\x12\x1b.anycable.DisconnectRequest\x1a\x1c.anycable.DisconnectResponse\"\x00\x62\x06proto3"
8
+ descriptor_data = "\n\trpc.proto\x12\x08\x61nycable\"\xa3\x02\n\x03\x45nv\x12\x0b\n\x03url\x18\x01 \x01(\t\x12+\n\x07headers\x18\x02 \x03(\x0b\x32\x1a.anycable.Env.HeadersEntry\x12)\n\x06\x63state\x18\x03 \x03(\x0b\x32\x19.anycable.Env.CstateEntry\x12)\n\x06istate\x18\x04 \x03(\x0b\x32\x19.anycable.Env.IstateEntry\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0b\x43stateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bIstateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd1\x01\n\x0b\x45nvResponse\x12\x31\n\x06\x63state\x18\x01 \x03(\x0b\x32!.anycable.EnvResponse.CstateEntry\x12\x31\n\x06istate\x18\x02 \x03(\x0b\x32!.anycable.EnvResponse.IstateEntry\x1a-\n\x0b\x43stateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bIstateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"G\n\x10PresenceResponse\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04info\x18\x03 \x01(\t\x12\x0b\n\x03ttl\x18\x04 \x01(\r\"/\n\x11\x43onnectionRequest\x12\x1a\n\x03\x65nv\x18\x03 \x01(\x0b\x32\r.anycable.Env\"\x99\x01\n\x12\x43onnectionResponse\x12 \n\x06status\x18\x01 \x01(\x0e\x32\x10.anycable.Status\x12\x13\n\x0bidentifiers\x18\x02 \x01(\t\x12\x15\n\rtransmissions\x18\x03 \x03(\t\x12\x11\n\terror_msg\x18\x04 \x01(\t\x12\"\n\x03\x65nv\x18\x05 \x01(\x0b\x32\x15.anycable.EnvResponse\"\x7f\n\x0e\x43ommandMessage\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x01(\t\x12\x1e\n\x16\x63onnection_identifiers\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x1a\n\x03\x65nv\x18\x05 \x01(\x0b\x32\r.anycable.Env\"\x83\x02\n\x0f\x43ommandResponse\x12 \n\x06status\x18\x01 \x01(\x0e\x32\x10.anycable.Status\x12\x12\n\ndisconnect\x18\x02 \x01(\x08\x12\x14\n\x0cstop_streams\x18\x03 \x01(\x08\x12\x0f\n\x07streams\x18\x04 \x03(\t\x12\x15\n\rtransmissions\x18\x05 \x03(\t\x12\x11\n\terror_msg\x18\x06 \x01(\t\x12\"\n\x03\x65nv\x18\x07 \x01(\x0b\x32\x15.anycable.EnvResponse\x12\x17\n\x0fstopped_streams\x18\x08 \x03(\t\x12,\n\x08presence\x18\t \x01(\x0b\x32\x1a.anycable.PresenceResponse\"[\n\x11\x44isconnectRequest\x12\x13\n\x0bidentifiers\x18\x01 \x01(\t\x12\x15\n\rsubscriptions\x18\x02 \x03(\t\x12\x1a\n\x03\x65nv\x18\x05 \x01(\x0b\x32\r.anycable.Env\"I\n\x12\x44isconnectResponse\x12 \n\x06status\x18\x01 \x01(\x0e\x32\x10.anycable.Status\x12\x11\n\terror_msg\x18\x02 \x01(\t*-\n\x06Status\x12\t\n\x05\x45RROR\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x0b\n\x07\x46\x41ILURE\x10\x02\x32\xda\x01\n\x03RPC\x12\x46\n\x07\x43onnect\x12\x1b.anycable.ConnectionRequest\x1a\x1c.anycable.ConnectionResponse\"\x00\x12@\n\x07\x43ommand\x12\x18.anycable.CommandMessage\x1a\x19.anycable.CommandResponse\"\x00\x12I\n\nDisconnect\x12\x1b.anycable.DisconnectRequest\x1a\x1c.anycable.DisconnectResponse\"\x00\x42\x0b\xea\x02\x08\x41nyCableb\x06proto3"
9
9
 
10
10
  pool = Google::Protobuf::DescriptorPool.generated_pool
11
11
  pool.add_serialized_file(descriptor_data)
@@ -13,6 +13,7 @@ pool.add_serialized_file(descriptor_data)
13
13
  module AnyCable
14
14
  Env = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.Env").msgclass
15
15
  EnvResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.EnvResponse").msgclass
16
+ PresenceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.PresenceResponse").msgclass
16
17
  ConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.ConnectionRequest").msgclass
17
18
  ConnectionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.ConnectionResponse").msgclass
18
19
  CommandMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("anycable.CommandMessage").msgclass
@@ -42,6 +42,19 @@ module AnyCable
42
42
  )
43
43
  end
44
44
 
45
+ def build_presence_response(socket)
46
+ return unless socket.presence
47
+
48
+ info = socket.presence[:info]
49
+ info = info.to_json if info && !info.is_a?(String)
50
+
51
+ AnyCable::PresenceResponse.new(
52
+ type: socket.presence.fetch(:type),
53
+ id: socket.presence.fetch(:id),
54
+ info: info
55
+ )
56
+ end
57
+
45
58
  def logger
46
59
  AnyCable.logger
47
60
  end
@@ -27,7 +27,8 @@ module AnyCable
27
27
  streams: socket.streams[:start],
28
28
  stopped_streams: socket.streams[:stop],
29
29
  transmissions: socket.transmissions,
30
- env: build_env_response(socket)
30
+ env: build_env_response(socket),
31
+ presence: build_presence_response(socket)
31
32
  )
32
33
  end
33
34
  end
@@ -4,6 +4,7 @@ require "stringio"
4
4
 
5
5
  module AnyCable
6
6
  WHISPER_KEY = "$w"
7
+ PRESENCE_KEY = "$p"
7
8
 
8
9
  # Socket mock to be used with application connection
9
10
  class Socket
@@ -46,7 +47,7 @@ module AnyCable
46
47
  end
47
48
  end
48
49
 
49
- attr_reader :transmissions
50
+ attr_reader :transmissions, :presence
50
51
 
51
52
  def initialize(env:)
52
53
  @transmissions = []
@@ -58,11 +59,11 @@ module AnyCable
58
59
  end
59
60
 
60
61
  def subscribe(_channel, broadcasting)
61
- streams[:start] << broadcasting
62
+ streams[:start] << broadcasting unless streams[:start].include?(broadcasting)
62
63
  end
63
64
 
64
65
  def unsubscribe(_channel, broadcasting)
65
- streams[:stop] << broadcasting
66
+ streams[:stop] << broadcasting unless streams[:stop].include?(broadcasting)
66
67
 
67
68
  if istate.read(WHISPER_KEY) == broadcasting
68
69
  istate.write(WHISPER_KEY, "")
@@ -73,6 +74,21 @@ module AnyCable
73
74
  istate.write(WHISPER_KEY, broadcasting)
74
75
  end
75
76
 
77
+ def presence_join(broadcasting, id, info)
78
+ raise ArgumentError, "ID is required for presence tracking" unless id
79
+
80
+ subscribe("", broadcasting)
81
+ istate.write(PRESENCE_KEY, broadcasting)
82
+
83
+ @presence = {type: "join", id: id, info: info}.compact
84
+ end
85
+
86
+ def presence_leave(id)
87
+ raise ArgumentError, "ID is required for presence tracking" unless id
88
+
89
+ @presence = {type: "leave", id: id}
90
+ end
91
+
76
92
  def unsubscribe_from_all(_channel)
77
93
  @stop_all_streams = true
78
94
  if istate.read(WHISPER_KEY)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.5.2"
4
+ VERSION = "1.6.0.rc.1"
5
5
  end
@@ -3,6 +3,7 @@ module AnyCable
3
3
  interface _Handler
4
4
  def build_socket: (env: Env) -> Socket
5
5
  def build_env_response: (Socket socket) -> EnvResponse
6
+ def build_presence_response: (Socket socket) -> PresenceResponse?
6
7
  def logger: () -> Logger
7
8
  def factory: () -> _ConnectionFactory
8
9
  end
data/sig/anycable/rpc.rbs CHANGED
@@ -41,6 +41,16 @@ module AnyCable
41
41
  def initialize: (?cstate: protoMap?, ?istate: protoMap?) -> void
42
42
  end
43
43
 
44
+ type presenceEvent = "join" | "leave" | "update"
45
+
46
+ class PresenceResponse
47
+ attr_accessor type: presenceEvent
48
+ attr_accessor id: String
49
+ attr_accessor info: String?
50
+
51
+ def initialize: (?type: presenceEvent, ?id: String, ?info: String) -> void
52
+ end
53
+
44
54
  interface _ProtoMessage
45
55
  def initialize: (**untyped) -> void
46
56
  end
@@ -130,6 +140,7 @@ module AnyCable
130
140
  attr_accessor error_msg: String?
131
141
  attr_accessor env: EnvResponse
132
142
  attr_accessor stopped_streams: Array[String]
143
+ attr_accessor presence: PresenceResponse
133
144
 
134
145
  %a{rbs:test:skip} def initialize: (
135
146
  status: rpcStatus,
@@ -139,7 +150,8 @@ module AnyCable
139
150
  ?stopped_streams: Array[String],
140
151
  ?transmissions: Array[String],
141
152
  ?error_msg: String,
142
- ?env: EnvResponse
153
+ ?env: EnvResponse?,
154
+ ?presence: PresenceResponse?
143
155
  ) -> void
144
156
 
145
157
  def to_h: () -> Hash[Symbol, untyped]
@@ -15,6 +15,7 @@ module AnyCable
15
15
 
16
16
  attr_reader transmissions: Array[String]
17
17
  attr_reader request_env: Env
18
+ attr_reader presence: Hash[Symbol, untyped]?
18
19
 
19
20
  def initialize: (env: Env) -> void
20
21
  def transmit: (String) -> void
@@ -30,6 +31,9 @@ module AnyCable
30
31
  def env: () -> Hash[String, untyped]
31
32
  def cstate: () -> State
32
33
  def istate: () -> State
34
+ def whisper: (String, String) -> void
35
+ def presence_join: (String, String, String | Hash[untyped, untyped]) -> void
36
+ def presence_leave: (String) -> void
33
37
 
34
38
  private
35
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0.rc.1
5
5
  platform: ruby
6
6
  authors:
7
- - palkan
7
+ - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-28 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -220,8 +220,8 @@ dependencies:
220
220
  - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: 1.9.1
223
- description: AnyCable core RPC implementation not depenending on a particular server
224
- type (e.g., gRPC or whatever)
223
+ description: Ruby SDK for AnyCable, an open-source realtime server for reliable two-way
224
+ communication
225
225
  email:
226
226
  - dementiev.vm@gmail.com
227
227
  executables:
@@ -309,15 +309,15 @@ files:
309
309
  - sig/anycable/streams.rbs
310
310
  - sig/anycable/version.rbs
311
311
  - sig/manifest.yml
312
- homepage: http://github.com/anycable/anycable
312
+ homepage: http://github.com/anycable/anycable-rb
313
313
  licenses:
314
314
  - MIT
315
315
  metadata:
316
- bug_tracker_uri: http://github.com/anycable/anycable/issues
317
- changelog_uri: https://github.com/anycable/anycable/blob/master/CHANGELOG.md
316
+ bug_tracker_uri: http://github.com/anycable/anycable-rb/issues
317
+ changelog_uri: https://github.com/anycable/anycable-rb/blob/master/CHANGELOG.md
318
318
  documentation_uri: https://docs.anycable.io/
319
319
  homepage_uri: https://anycable.io/
320
- source_code_uri: http://github.com/anycable/anycable
320
+ source_code_uri: http://github.com/anycable/anycable-rb
321
321
  funding_uri: https://github.com/sponsors/anycable
322
322
  post_install_message:
323
323
  rdoc_options: []
@@ -330,12 +330,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
330
  version: '2.7'
331
331
  required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  requirements:
333
- - - ">="
333
+ - - ">"
334
334
  - !ruby/object:Gem::Version
335
- version: '0'
335
+ version: 1.3.1
336
336
  requirements: []
337
337
  rubygems_version: 3.4.19
338
338
  signing_key:
339
339
  specification_version: 4
340
- summary: AnyCable core RPC implementation
340
+ summary: Ruby SDK for AnyCable, an open-source realtime server for reliable two-way
341
+ communication
341
342
  test_files: []