volcano-sdk 0.31.0 → 0.32.0
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 +4 -4
- data/lib/volcano/realtime/broadcast_delivery.rb +26 -2
- data/lib/volcano/realtime/channel_callbacks.rb +19 -14
- data/lib/volcano/realtime/channel_lifecycle.rb +9 -9
- data/lib/volcano/realtime/connection.rb +9 -5
- data/lib/volcano/realtime/connection_callbacks.rb +5 -1
- data/lib/volcano/realtime/lifecycle.rb +2 -1
- data/lib/volcano/realtime/postgres_batch.rb +11 -3
- data/lib/volcano/realtime/postgres_changes.rb +31 -16
- data/lib/volcano/realtime/postgres_database.rb +14 -1
- data/lib/volcano/realtime/postgres_delivery.rb +6 -1
- data/lib/volcano/realtime/postgres_expansion.rb +10 -4
- data/lib/volcano/realtime/presence.rb +18 -4
- data/lib/volcano/realtime/presence_state.rb +23 -6
- data/lib/volcano/realtime/protocol.rb +14 -9
- data/lib/volcano/realtime/protocol_dispatch.rb +25 -7
- data/lib/volcano/realtime/protocol_io.rb +8 -4
- data/lib/volcano/realtime/protocol_lifecycle.rb +2 -0
- data/lib/volcano/realtime/protocol_publication_dispatch.rb +12 -10
- data/lib/volcano/realtime/protocol_recovery.rb +7 -3
- data/lib/volcano/realtime/protocol_recovery_dispatch.rb +2 -0
- data/lib/volcano/realtime/reconnect.rb +4 -1
- data/lib/volcano/realtime.rb +122 -99
- data/lib/volcano/version.rb +1 -1
- data/sig/realtime.rbs +46 -0
- data/sig/realtime_postgres_change.rbs +1 -2
- metadata +2 -1
data/sig/realtime.rbs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module Volcano
|
|
2
|
+
class Client
|
|
3
|
+
attr_reader auth: Auth
|
|
4
|
+
attr_reader realtime: Realtime
|
|
5
|
+
|
|
6
|
+
def initialize: (anon_key: String, ?api_url: String, ?service_key: String?, ?timeout: Integer, ?access_token: String?, ?refresh_token: String?) -> void
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class Realtime
|
|
10
|
+
def channel: (String name, ?type: String | Symbol, ?auto_fetch: bool, ?fetch_batch_window_ms: Integer, ?fetch_max_batch_size: Integer) -> Channel
|
|
11
|
+
def connected?: () -> bool
|
|
12
|
+
def disconnect: () -> void
|
|
13
|
+
def remove_channel: (String name, ?type: String | Symbol) -> nil
|
|
14
|
+
def remove_all_channels: () -> nil
|
|
15
|
+
|
|
16
|
+
def on_connect: (^(ConnectContext) -> void callback) -> ^() -> Proc?
|
|
17
|
+
| () { (ConnectContext) -> void } -> ^() -> Proc?
|
|
18
|
+
def on_disconnect: (^(DisconnectContext) -> void callback) -> ^() -> Proc?
|
|
19
|
+
| () { (DisconnectContext) -> void } -> ^() -> Proc?
|
|
20
|
+
def on_error: (^(ErrorContext) -> void callback) -> ^() -> Proc?
|
|
21
|
+
| () { (ErrorContext) -> void } -> ^() -> Proc?
|
|
22
|
+
|
|
23
|
+
def database_name: () -> String?
|
|
24
|
+
def database_name=: (String? name) -> String?
|
|
25
|
+
|
|
26
|
+
class Channel
|
|
27
|
+
attr_reader name: String
|
|
28
|
+
|
|
29
|
+
def subscribe: () -> nil
|
|
30
|
+
def unsubscribe: () -> nil
|
|
31
|
+
def send: (event: String | Symbol, **json_value payload) -> nil
|
|
32
|
+
|
|
33
|
+
def on: (String event, ^(Object?) -> void callback) -> self
|
|
34
|
+
| (String event) { (Object?) -> void } -> self
|
|
35
|
+
def on_presence_sync: (^(Hash[String, PresenceInfo]) -> void callback) -> self
|
|
36
|
+
| () { (Hash[String, PresenceInfo]) -> void } -> self
|
|
37
|
+
def on_postgres_changes: (String | Symbol event, schema: String, table: String, callback: ^(PostgresChange) -> void) -> self
|
|
38
|
+
| (String | Symbol event, schema: String, table: String) { (PostgresChange) -> void } -> self
|
|
39
|
+
|
|
40
|
+
def track: (?Hash[String, json_value] state) -> nil
|
|
41
|
+
def presence_state: () -> Hash[String, PresenceInfo]
|
|
42
|
+
def get_presence_state: () -> Hash[String, PresenceInfo]
|
|
43
|
+
def tracked_state: () -> Hash[String, json_value]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -17,8 +17,7 @@ module Volcano
|
|
|
17
17
|
| (type: String, schema: String, table: String, timestamp: String, ?record: Hash[String, json_value]?, ?old_record: Hash[String, json_value]?, ?columns: Array[json_value]?, ?id: json_value, ?mode: String?) -> PostgresChange
|
|
18
18
|
def self.members: () -> [:type, :schema, :table, :record, :old_record, :columns, :timestamp, :id, :mode]
|
|
19
19
|
|
|
20
|
-
def initialize: (type: String, schema: String, table: String, timestamp: String, ?
|
|
21
|
-
| (String type, String schema, String table, Hash[String, json_value]? record, Hash[String, json_value]? old_record, Array[json_value]? columns, String timestamp, json_value id, String? mode) -> void
|
|
20
|
+
def initialize: (type: String, schema: String, table: String, timestamp: String, **Object? payload) -> void
|
|
22
21
|
def members: () -> [:type, :schema, :table, :record, :old_record, :columns, :timestamp, :id, :mode]
|
|
23
22
|
def with: (?type: String, ?schema: String, ?table: String, ?record: Hash[String, json_value]?, ?old_record: Hash[String, json_value]?, ?columns: Array[json_value]?, ?timestamp: String, ?id: json_value, ?mode: String?) -> PostgresChange
|
|
24
23
|
def to_h: () -> { type: String, schema: String, table: String, record: Hash[String, json_value]?, old_record: Hash[String, json_value]?, columns: Array[json_value]?, timestamp: String, id: json_value, mode: String? }
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: volcano-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.32.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kong
|
|
@@ -629,6 +629,7 @@ files:
|
|
|
629
629
|
- sig/lock_records.rbs
|
|
630
630
|
- sig/log_responses.rbs
|
|
631
631
|
- sig/oauth_records.rbs
|
|
632
|
+
- sig/realtime.rbs
|
|
632
633
|
- sig/realtime_contexts.rbs
|
|
633
634
|
- sig/realtime_postgres_change.rbs
|
|
634
635
|
- sig/session.rbs
|