oceanex-slanger 0.7.1.1 → 0.7.1.2
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/README.md +77 -69
- data/lib/slanger/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a4b71d852148b5f095a4d6caa15454412d86f480a628c69f3adc217ae244740
|
4
|
+
data.tar.gz: 590333fe96c91702116b3785b6198f598e7e7ef0060aeda9f40c6a624c8203d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 387e851b971143cefcb7a53ea7dac284b1ad4f9632e6dfc9a2a5251fc4ea92dff4d6f803cbefca392cb43e197fc4f1421cf9aa2f8573a9cb0c1bda27902c7ea9
|
7
|
+
data.tar.gz: 3af58c398d22e85c4cdcd579f06bcb12f817abe97a219c33b0389e9f771ac4a2f1018a3ef32581455c8dfb7c774ee3934117f737714cc90983a8578f09db6375
|
data/README.md
CHANGED
@@ -1,59 +1,23 @@
|
|
1
|
-
# Slanger
|
1
|
+
# OceanEx Slanger
|
2
2
|
|
3
|
-
|
4
|
-
This is the most important reason I decide to continue to maintain slanger. The maintenance will continue until future notice or better option comes out.
|
3
|
+
The OceanEx Slanger inherits from the unmaintained Slanger. The project is backed by OceanEx dev team.
|
5
4
|
|
6
|
-
|
5
|
+
We will do regularly bug fixes and security updates.
|
7
6
|
|
8
|
-
|
7
|
+
We might future add more features or provide performance improvements for OceanEx Slanger. The maintenance will continue until we find better option.
|
9
8
|
|
10
|
-
|
9
|
+
Feel free to log any issue or contribute to the code base.
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
redis-server &> /dev/null &
|
15
|
-
|
16
|
-
slanger --app_key 765ec374ae0a69f4ce44 --secret your-pusher-secret
|
17
|
-
```
|
18
|
-
|
19
|
-
Slanger is a standalone server ruby implementation of the Pusher protocol. It
|
20
|
-
is not designed to run inside a Rails or sinatra app, but it can be easily
|
21
|
-
installed as a gem.
|
22
|
-
|
23
|
-
Bundler has multiple purposes, one of which is useful for installation.
|
24
|
-
|
25
|
-
## About
|
26
|
-
|
27
|
-
Slanger is an open source server implementation of the Pusher protocol written
|
28
|
-
in Ruby. It is designed to scale horizontally across N nodes and to be agnostic
|
29
|
-
as to which Slanger node a subscriber is connected to, i.e subscribers to the
|
30
|
-
same channel are NOT required to be connected to the same Slanger node.
|
31
|
-
Multiple Slanger nodes can sit behind a load balancer with no special
|
32
|
-
configuration. In essence it was designed to be very easy to scale.
|
33
|
-
|
34
|
-
Presence channel state is shared using Redis. Channels are lazily instantiated
|
35
|
-
internally within a given Slanger node when the first subscriber connects. When
|
36
|
-
a presence channel is instantiated within a Slanger node, it queries Redis for
|
37
|
-
the global state across all nodes within the system for that channel, and then
|
38
|
-
copies that state internally. Afterwards, when subscribers connect or
|
39
|
-
disconnect the node publishes a presence message to all interested nodes, i.e.
|
40
|
-
all nodes with at least one subscriber interested in the given channel.
|
41
|
-
|
42
|
-
Slanger is smart enough to know if a new channel subscription belongs to the
|
43
|
-
same user. It will not send presence messages to subscribers in this case. This
|
44
|
-
happens when the user has multiple browser tabs open for example. Using a chat
|
45
|
-
room backed by presence channels as a real example, one would not want
|
46
|
-
"Barrington" to show up N times in the presence roster because Barrington
|
47
|
-
has the chat room open in N browser tabs.
|
11
|
+
**Important! OceanEx Slanger is not supposed to be included in your Gemfile. RubyGems is used as a distribution mechanism. If you include it in your app, you will likely get dependency conflicts.
|
12
|
+
PRs updating dependencies for compatibility with your app will be closed!**
|
48
13
|
|
49
|
-
Slanger
|
50
|
-
eventual consistency, which in practise is instantaneous.
|
14
|
+
OceanEx Slanger is a standalone server ruby implementation of the Pusher protocol. It is not designed to run inside a Rails or sinatra app, but it can be easily installed as a gem.
|
51
15
|
|
52
16
|
# How to use it
|
53
17
|
|
54
18
|
## Requirements
|
55
19
|
|
56
|
-
- Ruby 2.
|
20
|
+
- Ruby 2.6.3 or greater
|
57
21
|
- Redis
|
58
22
|
|
59
23
|
## Server setup
|
@@ -77,19 +41,62 @@ If you want to run multiple slanger instances in a cluster, one option will be t
|
|
77
41
|
A basic config can be found in the folder `examples`.
|
78
42
|
Haproxy can be also used for SSL termination, leaving slanger to not have to deal with SSL checks and so on, making it lighter.
|
79
43
|
|
44
|
+
## Installation instruction
|
80
45
|
|
81
|
-
|
46
|
+
The OceanEx Slanger depends on ruby 2.6.3 and above, please install ruby 2.6.3 first before install the OceanEx Slanger.
|
47
|
+
It could also run perfectly on the latest 2.7.1. If you want to align with the latest ruby, you might clone the source
|
48
|
+
code and compile yourself.
|
82
49
|
|
83
|
-
|
50
|
+
### Linux(Ubuntu)
|
84
51
|
|
85
|
-
|
52
|
+
You could install the right version of ruby via rbenv
|
86
53
|
|
87
|
-
```
|
88
|
-
|
54
|
+
```
|
55
|
+
sudo apt-get install rbenv
|
56
|
+
rbenv install 2.6.3
|
57
|
+
rbenv global 2.6.3
|
58
|
+
```
|
89
59
|
|
90
|
-
|
60
|
+
Usually, install the Oceanex Slanger should be pretty easy with the following command. OceanEx Slanger is just a variation of the unmaintained Slanger.
|
61
|
+
The execution kept the same way as before. Please check our release note to see what is new in additional to the unmaintained Slanger.
|
91
62
|
|
92
|
-
|
63
|
+
```
|
64
|
+
gem install oceanex-slanger
|
65
|
+
```
|
66
|
+
|
67
|
+
### Mac
|
68
|
+
|
69
|
+
Install the ruby version via brew
|
70
|
+
|
71
|
+
```
|
72
|
+
brew install ruby
|
73
|
+
```
|
74
|
+
|
75
|
+
You might also install via rbenv
|
76
|
+
```
|
77
|
+
brew install rbenv
|
78
|
+
rbenv install 2.6.3
|
79
|
+
rbenv global 2.6.3
|
80
|
+
```
|
81
|
+
|
82
|
+
Installation should be pretty straightforward on linux, however, install OceanEx Slanger might fail on mac os.
|
83
|
+
This is due to the c compiler converts the warning to error when building the native extension.
|
84
|
+
|
85
|
+
If you see installation fails due to `implicit-function-declaration`, you could try the following step to suppress the warning.
|
86
|
+
|
87
|
+
```
|
88
|
+
gem install oceanex-slanger -- --with-cflags="-Wno-error=implicit-function-declaration"
|
89
|
+
```
|
90
|
+
|
91
|
+
## Start the OceanEx Slanger in local environment
|
92
|
+
|
93
|
+
Both the app key and app secret are just random string, you could choose any string. However, it is recommended to be long
|
94
|
+
enough to keep secure.
|
95
|
+
|
96
|
+
Oceanex slanger also depends on redis service, specify the redis url when launching the OceanEx Slanger.
|
97
|
+
|
98
|
+
```
|
99
|
+
slanger --app_key $APP_KEY --secret $APP_SECRET -r $REDIS_URL
|
93
100
|
```
|
94
101
|
|
95
102
|
If all went to plan you should see the following output to STDOUT
|
@@ -113,26 +120,27 @@ Slanger API server listening on port 4567
|
|
113
120
|
Slanger WebSocket server listening on port 8080
|
114
121
|
```
|
115
122
|
|
116
|
-
##
|
123
|
+
## Start the OceanEx Slanger in Docker environment
|
117
124
|
|
118
|
-
|
119
|
-
|
125
|
+
The OceanEx slanger supports running in docker environment and such approach is already encapsulated in the make command.
|
126
|
+
The dependent Redis docker image is also automatically downloaded and started.
|
127
|
+
|
128
|
+
For the app key and app secret, please check `docker-compose.yaml` and modify as needed.
|
129
|
+
|
130
|
+
### Build the docker image
|
120
131
|
```
|
121
|
-
|
122
|
-
stop on runlevel [016]
|
123
|
-
respawn
|
124
|
-
script
|
125
|
-
LANG=en_US.UTF-8 /usr/local/rvm/gems/ruby-RUBY_VERISON/wrappers/slanger --app_key KEY --secret SECRET --redis_address redis://REDIS_IP:REDIS_PORT/REDIS_DB
|
126
|
-
end script
|
132
|
+
make build
|
127
133
|
```
|
128
|
-
This example assumes you're using rvm and a custom redis configuration
|
129
134
|
|
130
|
-
|
135
|
+
### Start the OceanEx slanger
|
131
136
|
```
|
132
|
-
|
133
|
-
service slanger stop
|
137
|
+
make up
|
134
138
|
```
|
135
139
|
|
140
|
+
### Stop the service
|
141
|
+
```
|
142
|
+
make down
|
143
|
+
```
|
136
144
|
|
137
145
|
## Modifying your application code to use the Slanger service
|
138
146
|
|
@@ -208,23 +216,23 @@ I wanted to write a non-trivial evented app. I also want to write a book on even
|
|
208
216
|
|
209
217
|
Pusher is an awesome service, very reasonably priced, and run by an awesome crew. Give them a spin on your next project.
|
210
218
|
|
211
|
-
# Author
|
219
|
+
# Original Author
|
212
220
|
|
213
221
|
- Stevie Graham
|
214
222
|
|
215
|
-
# Core Team
|
223
|
+
# Original Core Team
|
216
224
|
|
217
225
|
- Stevie Graham
|
218
226
|
- Mark Burns
|
219
227
|
|
220
|
-
# Contributors
|
228
|
+
# Original Contributors
|
221
229
|
|
222
230
|
- Stevie Graham
|
223
231
|
- Mark Burns
|
224
232
|
- Florian Gilcher
|
225
233
|
- Claudio Poli
|
226
234
|
|
227
|
-
# Maintainer
|
235
|
+
# Current Author and Maintainer
|
228
236
|
- joblee
|
229
237
|
|
230
238
|
|
data/lib/slanger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oceanex-slanger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.1.
|
4
|
+
version: 0.7.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joblee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -354,8 +354,8 @@ licenses:
|
|
354
354
|
- MIT
|
355
355
|
metadata:
|
356
356
|
homepage_uri: https://github.com/jobleeyoui/slanger
|
357
|
-
source_code_uri: https://github.com/jobleeyoui/slanger/archive/v0.7.
|
358
|
-
changelog_uri: https://github.com/jobleeyoui/slanger/releases
|
357
|
+
source_code_uri: https://github.com/jobleeyoui/oceanex-slanger/archive/v0.7.1.1.zip
|
358
|
+
changelog_uri: https://github.com/jobleeyoui/oceanex-slanger/releases
|
359
359
|
post_install_message:
|
360
360
|
rdoc_options: []
|
361
361
|
require_paths:
|