sse_cable 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8b33816983c43bfddf995c13d9324ce3af85a0ba18cedac6e42e5de897a1f31c
4
+ data.tar.gz: 9b15ecaa04d01a16b9e58d5ccde03ad0c309884a49736553669fd1c189343fd2
5
+ SHA512:
6
+ metadata.gz: 571584faae8a10c25f10fefcaebb0f352e671ee9c1b7c70d38fb22904d4f8fe389460f4cd1c9298ced784f476a60c8cc5abe4225adfd4b67b45372c4da628b02
7
+ data.tar.gz: bbbed3628cb62c1fb6152a7852bef6928b07db5151ccbb87205e8139214ab17835274a6f98957366ec994f0db3add574095873eb75ac7aa2ebdd184e9ebb74b0
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ SseCable.configure do |config|
4
+ #
5
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class Connection
5
+ def initialize(env)
6
+ # Initialize connection with environment
7
+ end
8
+
9
+ def transmit(event)
10
+ # Transmit event data to the client
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class ConnectionPool
5
+ def initialize(pool_size)
6
+ # Initialize connection pool with specified size
7
+ end
8
+
9
+ def acquire
10
+ # Acquire a connection from the pool
11
+ end
12
+
13
+ def release(connection)
14
+ # Release the connection back to the pool
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class Event
5
+ def initialize(data, options = {})
6
+ # Initialize event with data and options
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class MessageQueue
5
+ def initialize
6
+ # Initialize message queue
7
+ end
8
+
9
+ def enqueue(event)
10
+ # Enqueue an event in the message queue
11
+ end
12
+
13
+ def dequeue
14
+ # Dequeue the next event from the message queue
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class Middleware
5
+ def initialize(app)
6
+ # Initialize middleware with app
7
+ end
8
+
9
+ def call(env)
10
+ # Handle SSE requests in middleware
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class Server
5
+ def initialize(app, options = {})
6
+ # Initialize server with app and options
7
+ end
8
+
9
+ def call(env)
10
+ # Handle incoming SSE requests
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SseCable
4
+ class Subscription
5
+ def initialize(channel)
6
+ # Initialize subscription for a channel
7
+ end
8
+
9
+ def subscribe(connection)
10
+ # Subscribe connection to the subscription
11
+ end
12
+
13
+ def unsubscribe(connection)
14
+ # Unsubscribe connection from the subscription
15
+ end
16
+ end
17
+ end
data/lib/sse_cable.rb ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'sse_cable/connection'
4
+ require 'sse_cable/connection_pool'
5
+ require 'sse_cable/event'
6
+ require 'sse_cable/message_queue'
7
+ require 'sse_cable/server'
8
+ require 'sse_cable/subscription'
9
+ require 'sse_cable/middleware'
10
+
11
+ # entry point
12
+ module SseCable; end
@@ -0,0 +1 @@
1
+ // JavaScript code for SseCable frontend
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sse_cable
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Aleksandr Ulanov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-06-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actioncable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: redis
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: socketry-async
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: SseCable enables real-time communication between servers and clients,
98
+ allowing for efficient event broadcasting, channel subscriptions, and connection
99
+ management.
100
+ email:
101
+ - dev.ualeks@gmail.com
102
+ executables: []
103
+ extensions: []
104
+ extra_rdoc_files: []
105
+ files:
106
+ - lib/config/initializers/sse_cable.rb
107
+ - lib/sse_cable.rb
108
+ - lib/sse_cable/connection.rb
109
+ - lib/sse_cable/connection_pool.rb
110
+ - lib/sse_cable/event.rb
111
+ - lib/sse_cable/message_queue.rb
112
+ - lib/sse_cable/middleware.rb
113
+ - lib/sse_cable/server.rb
114
+ - lib/sse_cable/subscription.rb
115
+ - lib/sse_cable_frontend/sse_cable.js
116
+ homepage: https://github.com/ualeks/sse_cable
117
+ licenses:
118
+ - MIT
119
+ metadata:
120
+ homepage_uri: https://github.com/ualeks/sse_cable
121
+ source_code_uri: https://github.com/ualeks/sse_cable
122
+ changelog_uri: https://github.com/ualeks/sse_cable/blob/main/CHANGELOG.md
123
+ allowed_push_host: https://rubygems.org
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '2.6'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubygems_version: 3.3.7
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: Server-Sent Events (SSE) support for multiple Ruby frameworks.
143
+ test_files: []