cuboid 0.2.4.1 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79c0b3e985f2a90adb78952b569f9f32b58d5d99fe0b900415e04530ce5b7017
4
- data.tar.gz: 7d02a4469973ad273cc65816e09f5395cf44f114a250993c6480dd953a14555d
3
+ metadata.gz: d3b544e8f6eb34d19ba08d26c263435e34321ab174d86ce09da67b4b9651924d
4
+ data.tar.gz: eb9be57eccb9429514f04c66f36337669a9865d2f634d118eabe38d853ad5980
5
5
  SHA512:
6
- metadata.gz: fc6b0b8f9d99b926212a8806e25d02dd2ea05c448c4a436f628e1c8e9675e204ffdc322812b9329eeb70fab1c7f35b170ed19edf17cd216ceba57e75df188506
7
- data.tar.gz: 9343edf77b6cc9eeb593f46988b2baceca523a63898dcc05c6a7ec638d6bb65fd0c0e0342f313276dc609ff0ec60b13f61baa0d73e6e0224b9083497a82f6e5b
6
+ metadata.gz: ab705216690f6891f9530f1252ea6d782208f9707d4b1d6d6e75435489c6c1d6927f699662810f7daffc5dd726ecd0cef00817e4e11b75660699ac7886ab66ee
7
+ data.tar.gz: 134eaeefd0742c2de4cf22cbe9c7f805d5efb752a9194f737b393b51e1f4354241c2704de27a328fa45b37883c91182134964f495f4038c82e1cd0e89f3b052f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 0.2.5
2
+
3
+ * `RPC::Server::Services::Base` => `RPC::Server::Instance::Service`
4
+ * Added `RPC::Server::Instance::Peers` as a helper to iterate over peer `Instances`.
5
+
6
+ # 0.2.4.2
7
+
8
+ * Instance RPC services now decorated with `Server::Services::Base`.
9
+
1
10
  # 0.2.4.1
2
11
 
3
12
  * `Application`: Added `#application=` to help with inheritance.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cuboid Framework -- a decentralized distributed framework in Ruby.
1
+ # Cuboid Framework -- a decentralized & distributed computing framework in Ruby.
2
2
 
3
3
  ## Summary
4
4
 
@@ -8,6 +8,9 @@ distributed applications in Ruby.
8
8
  In hipper terms, you can very easily setup your own specialized _Cloud_ or
9
9
  _Cloud_ within a _Cloud_.
10
10
 
11
+ In older-fashioned terms you can build load-balanced, on-demand, clustered applications and even super-computers --
12
+ see [Peplum](https://github.com/peplum/).
13
+
11
14
  It offers:
12
15
 
13
16
  * Load-balancing of _**Instances**_ via a network (_**Grid**_) of _**Agents**_.
@@ -262,7 +265,9 @@ _You can replace `host1` with `localhost` and run all examples on the same machi
262
265
 
263
266
  ## Users
264
267
 
265
- * [QMap](https://github.com/qadron/qmap) -- A distributed network mapper/security scanner.
268
+ * [QMap](https://github.com/qadron/qmap) -- A distributed network mapper/security scanner powered by [nmap](http://nmap.org/).
269
+ * [Peplum](https://github.com/peplum/peplum) -- A distributed parallel processing solution -- allows you to build Beowulf
270
+ (or otherwise) clusters and even super-computers.
266
271
 
267
272
  ## License
268
273
 
@@ -0,0 +1,37 @@
1
+ module Cuboid
2
+ module RPC
3
+ class Server
4
+ class Instance
5
+
6
+ class Peers
7
+ include Enumerable
8
+
9
+ def initialize
10
+ @peers = {}
11
+ end
12
+
13
+ def set( peer_info )
14
+ peer_info.each do |url, token|
15
+ next if url == self.self_url
16
+ @peers[url] = Cuboid::Application.application.connect( url: url, token: token )
17
+ end
18
+
19
+ nil
20
+ end
21
+
22
+ def each( &block )
23
+ @peers.each do |_, client|
24
+ block.call client
25
+ end
26
+ end
27
+
28
+ def self_url
29
+ Cuboid::Options.rpc.url
30
+ end
31
+
32
+ end
33
+
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,20 @@
1
+ module Cuboid
2
+ module RPC
3
+ class Server
4
+ class Instance
5
+ module Service
6
+
7
+ attr_reader :name
8
+ attr_reader :instance
9
+
10
+ def initialize( name, instance )
11
+ @name = name
12
+ @instance = instance
13
+ end
14
+
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+ end
@@ -12,6 +12,9 @@ require lib + 'rpc/server/active_options'
12
12
  require lib + 'rpc/server/output'
13
13
  require lib + 'rpc/server/application_wrapper'
14
14
 
15
+ require lib + 'rpc/server/instance/service'
16
+ require lib + 'rpc/server/instance/peers'
17
+
15
18
  module RPC
16
19
  class Server
17
20
 
@@ -297,7 +300,7 @@ class Instance
297
300
  end
298
301
  end
299
302
 
300
- # Starts RPC service.
303
+ # Starts RPC services.
301
304
  def _run
302
305
  Raktr.global.on_error do |_, e|
303
306
  print_error "Reactor: #{e}"
@@ -332,7 +335,8 @@ class Instance
332
335
  server.add_handler( 'options', @active_options )
333
336
 
334
337
  Cuboid::Application.application.instance_services.each do |name, service|
335
- si = service.new
338
+ service.include Server::Instance::Service
339
+ si = service.new( name, self )
336
340
 
337
341
  Cuboid::Application.application.send :attr_reader, name
338
342
  @application.application.instance_variable_set( "@#{name}".to_sym, si )
data/lib/version CHANGED
@@ -1 +1 @@
1
- 0.2.4.1
1
+ 0.2.5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuboid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4.1
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tasos Laskos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -296,6 +296,8 @@ files:
296
296
  - lib/cuboid/rpc/server/application_wrapper.rb
297
297
  - lib/cuboid/rpc/server/base.rb
298
298
  - lib/cuboid/rpc/server/instance.rb
299
+ - lib/cuboid/rpc/server/instance/peers.rb
300
+ - lib/cuboid/rpc/server/instance/service.rb
299
301
  - lib/cuboid/rpc/server/output.rb
300
302
  - lib/cuboid/rpc/server/scheduler.rb
301
303
  - lib/cuboid/ruby.rb