simplepubsub_drb 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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data/lib/simplepubsub_drb.rb +47 -0
- data.tar.gz.sig +0 -0
- metadata +111 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 96aa84b127adea59a6a3a8f5ebdf961d6a4ac206482f58ad212a80532c47b1ad
|
4
|
+
data.tar.gz: 3654b7324368951f3239a3238ac1b0db7b0066610544852f68ef7c8bad1d3ffb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bce497b98e26ffc514ec36e90b9bbc5157141e3b482570756247f31f884e964ed5f9519c294a51c4dae4068e74deb76b6344a6521e74e35b20374404cb248c4c
|
7
|
+
data.tar.gz: 7afe740636f71d7a78e1ffe938eea559b9013e206f7fd58e3ae9018dc5fd8c0d929fcd1a9874ff8d875f97e8a3108f2a48084878e61af43c8c4767f1f35d3dd5
|
checksums.yaml.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: simplepubsub_drb.rb
|
4
|
+
|
5
|
+
require 'onedrb'
|
6
|
+
require 'xml-registry'
|
7
|
+
|
8
|
+
|
9
|
+
module SimplePubSubDRb
|
10
|
+
class Internals
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@h = {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def publish(fqm)
|
17
|
+
|
18
|
+
topic, msg = fqm.split(/: +/,2)
|
19
|
+
|
20
|
+
reg = XMLRegistry.new
|
21
|
+
reg.set_key topic, ''
|
22
|
+
|
23
|
+
# find the subscribers who match the current topic
|
24
|
+
#
|
25
|
+
a = @h.select {|key, value| reg.get_key(key) }
|
26
|
+
|
27
|
+
a.map(&:last).flatten(1).uniq.each do |ip_address|
|
28
|
+
subscriber = OneDrb::Client.new host: ip_address, port: '59003'
|
29
|
+
subscriber.receive(topic, msg)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
def subscribe(topic, ip_address)
|
35
|
+
@h[topic] ||= []
|
36
|
+
@h[topic] << ip_address
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
class Broker
|
42
|
+
def self.start(host: '0.0.0.0', port: '59004')
|
43
|
+
drb = OneDrb::Server.new host: host, port: port, obj: Internals.new
|
44
|
+
drb.start
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simplepubsub_drb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEljCCAv6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTIzMDMwNTE4NTQzNVoXDTI0MDMwNDE4NTQzNVowSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|
+
EjAQBgoJkiaJk/IsZAEZFgJldTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoC
|
18
|
+
ggGBAKaImICz63MCzCRMje64u7jT+9zogNVff0ti7VsCF8RQnBYXiaxG1M+6Q7LU
|
19
|
+
KFgnKp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iS+wRLRuKjdB07v3
|
34
|
+
/kaupZC7aJIfvECUpxmm+g3nbZyCWqfZRtMKFQc5c6J21KnMiisAs+xRdQPZRtDx
|
35
|
+
W2sR1DZEkWzwssckzjTlTdzmSZ1ozHn28JIBZeXQTw1WssboCJ2TdGn98zANPMuz
|
36
|
+
7qdJNfBqP+NBScJ6xvqF7wjuVrxIFA7c8qaicysm744zeG23hcQG+DwtE7K7JSI1
|
37
|
+
xp13HpFypMQQijpOpU9cnCpT9ATbqpEA19E=
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: onedrb
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.4'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.4.2
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0.4'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.4.2
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: xml-registry
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0.8'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 0.8.0
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0.8'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 0.8.0
|
81
|
+
description:
|
82
|
+
email: digital.robertson@gmail.com
|
83
|
+
executables: []
|
84
|
+
extensions: []
|
85
|
+
extra_rdoc_files: []
|
86
|
+
files:
|
87
|
+
- lib/simplepubsub_drb.rb
|
88
|
+
homepage: https://github.com/jrobertson/simplepubsub_drb
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
requirements: []
|
107
|
+
rubygems_version: 3.4.6
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Inspired by SimplePubSub and uses DRb instead of WebSocket.
|
111
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|