spsdrbsub 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: 977a0117c39cdef70129b5f741f0a5a17687c41231e2dcdfc46cfba03d8bc93f
4
+ data.tar.gz: b4908565c008aee86dd28521b9bed85e248841f489b725d8c57a3d78ca6a3685
5
+ SHA512:
6
+ metadata.gz: 740975493b912a0a5b21a1e948a851b0adc896b5a7b75c32848feba26886edb46e0886f9cabd347f085c78b61be896f5614a626ec35eff19e959d5a055dbd690
7
+ data.tar.gz: bd9eb94874e7d5125bc4c1cd7908b28c60079b74119b55a76454cc61441a6e454c766a0324c5ddbf6178617bf83ad90ce4ac65db42c840a4a3cc59bffffd70c8
checksums.yaml.gz.sig ADDED
@@ -0,0 +1 @@
1
+ �`���6���9���{�_�>�3)s�gS�l�����m&�$�D
data/lib/spsdrbsub.rb ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: spsdrbsub.rb
4
+
5
+ require 'onedrb'
6
+
7
+ class Subscriber
8
+
9
+ def initialize(blk)
10
+ @blk = blk
11
+ end
12
+
13
+ def receive(topic, message)
14
+ @blk.call(message, topic)
15
+ end
16
+
17
+ end
18
+
19
+ class SpsDRbSub
20
+
21
+ def initialize(client_ip='0.0.0.0', port: '59003', host: '127.0.0.1',
22
+ brokerport: '59004')
23
+
24
+ @client_ip, @port, @host, @brokerport = client_ip, port, host, brokerport
25
+
26
+ end
27
+
28
+ def subscribe(topic, &blk)
29
+
30
+ broker = OneDrb::Client.new host: @host, port: @brokerport
31
+ broker.subscribe topic, @client_ip
32
+ client = OneDrb::Server.new host: @client_ip, port: @port,
33
+ obj: Subscriber.new(blk)
34
+ client.start
35
+ end
36
+
37
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spsdrbsub
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
+ 8ixkARkWAmV1MB4XDTIzMDMwNjA4NTM1OVoXDTI0MDMwNTA4NTM1OVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoC
18
+ ggGBAMy1YOrGcv5HPQCd+0PtnFJXS5irZO/si3u8Jl9xwf3SKtJ26xF++K9SEncj
19
+ i28hbwwmmt77hFPTNIPq1VoqWAS1Lh+pVJLmcwhpiqbVX6j5o29hDwPqAwrzGDJF
20
+ ZbOlQTx1au2G71UF7Z7zhfvbRMdySHLjmSfnJESOiKso4vCfS3RllXYZoojZ9GM+
21
+ OAchJCT+Iud49OYENpIr33jHgf7fbMepiC/2u1oDzYX2L40KXxFd8QaSUHWqX1YG
22
+ +RlqUSUeL7xvB3D3uI2L88Xov5QB2MBihn+9nCe7rTDRcmpMQxYwLgUwYk221c+N
23
+ lh26hJjQuFnrvEm/3/JDlrXAnHh2BGePjJ0TneTZ8Crr2eDwEWdNm9hFUvTL5CzK
24
+ HiMOgfChPutrdTzY0RO85oBboy1Yl+Xapfd7gi9PoD6cZjTeMw1q63yu8iSVhDHN
25
+ zv4uJ6kvAdP4jfeY2kzW6lUnukame8nvw/1OdiNE0nGKEezJPTtXosHiGz53EtmV
26
+ ekvLwwIDAQABo4GKMIGHMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
27
+ BBT4KRdi9lErHBBynuGkm6VyVVV3oDAmBgNVHREEHzAdgRtnZW1tYXN0ZXJAamFt
28
+ ZXNyb2JlcnRzb24uZXUwJgYDVR0SBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
29
+ c29uLmV1MA0GCSqGSIb3DQEBCwUAA4IBgQCY6laT0XR8WXZkWLgDiHcHdgTeiOBT
30
+ keKnaFZttnkY/h3XtX5AcKUNQUF++JuPwKGWFJwf7/6mHyVbs5VI0jOX4aOKnhDX
31
+ loRF8/0TjbFmk7h3mD40n3j2edZQnyzrKTtwPhR5mrjnvuG48fO51XirVqlahKSe
32
+ NMdE/2KeaRkJBCxsKAw2AI2A5cVeZrPdu/l+T5PqBXDD4xBWqspxix5hZfXLiVWZ
33
+ f0GJv/20Us97DITsidNAKapYlg3fg7iPN82N3yselP5pIMK73k1y2lXwz7jKEfiF
34
+ 2QVz33y8H6iX+yM9s1KFVk6l/6AalSzL5wMjFKqJyTYILWlw4ZHUqZVtEWkrn8Jo
35
+ koqV/+RyE4UyCuTlzg9WHzQMVQyLEXqv221FXBk9ehKGPSLkxX4BssVKKsx6oAB+
36
+ HjdbbnU6PLttAiSV6nkP3eqaKb8rep/W2MzLDZSy6SxE903M4iLF33gmlPFJk5Pb
37
+ DkQZPz8FfHHiuLM/1iDRsbwUmyzmVRlLbtQ=
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
+ description:
62
+ email: digital.robertson@gmail.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - lib/spsdrbsub.rb
68
+ homepage: https://github.com/jrobertson/spsdrbsub
69
+ licenses:
70
+ - MIT
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubygems_version: 3.4.6
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: Subscribes to a topic from the simplepubsub_drb broker.
91
+ test_files: []
metadata.gz.sig ADDED
Binary file