cuboid 0.2.4.2 → 0.2.6

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: e1591d4ea28efb0163566ff380d5cb5bd66c6fdb161e70faee67b2fdeda12fc4
4
- data.tar.gz: 6aba361e06c053f03ae86bca93b322afef249740376fe328710f75fbc7889cb5
3
+ metadata.gz: 16117ddd8bcfeb196beb164a425a2a42643a121ba8b511f5f78ed193b177c858
4
+ data.tar.gz: 9553e538510f8b9f1262c7d11cac98dffca53e1989d0d2dabc56e201bd555a63
5
5
  SHA512:
6
- metadata.gz: 404d0460e9de33909a3a8c6504e8ed5744ec363ab4e1b4304304b75455037e7a1002129f8c0a0551c7c6fba8bd250f9d5207dc8df93063cc6d3db231ca0bb477
7
- data.tar.gz: 588642b0dc6ec0f2aff03bde48b6161db0652585d8463536c640fdf864d217998a24016f2dbf3b90c87c1eead7767a890ee487eace72ca57518331d362552f33
6
+ metadata.gz: b3af03cb62af997478c66ae905e43c1a10efc7971833dd12cd8d46e964cdfa7469578d8ed86c02117448a91beff5020a1418872e6d9a117638289c77969331aa
7
+ data.tar.gz: c16194307cd888377f2a9030de4c7540d1c15bd5458e696f11c3b417f38ca08ed0c956eb6e41d328d4afa5b10bd3652e2e2b6d30990d7136924c6d14e2e82598
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 0.2.6
2
+
3
+ * `Application.serializer` now defaults to JSON for REST API compatibility.
4
+
5
+ # 0.2.5
6
+
7
+ * `RPC::Server::Services::Base` => `RPC::Server::Instance::Service`
8
+ * Added `RPC::Server::Instance::Peers` as a helper to iterate over peer `Instances`.
9
+
1
10
  # 0.2.4.2
2
11
 
3
12
  * Instance RPC services now decorated with `Server::Services::Base`.
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,8 +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.
266
- * [Peplum](https://github.com/peplum/peplum) -- A cluster/supercomputer builder.
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.
267
271
 
268
272
  ## License
269
273
 
@@ -153,7 +153,9 @@ class Application
153
153
 
154
154
  def serializer
155
155
  @serializer ||= nil
156
- @serializer || RPC::Serializer
156
+
157
+ # Default to JSON for REST API compatibility.
158
+ @serializer || JSON
157
159
  end
158
160
 
159
161
  def validate_options_with( handler )
@@ -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
@@ -1,9 +1,8 @@
1
1
  module Cuboid
2
2
  module RPC
3
3
  class Server
4
- module Services
5
-
6
- module Base
4
+ class Instance
5
+ module Service
7
6
 
8
7
  attr_reader :name
9
8
  attr_reader :instance
@@ -18,5 +17,4 @@ end
18
17
  end
19
18
  end
20
19
  end
21
-
22
20
  end
@@ -12,7 +12,8 @@ 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/services/base'
15
+ require lib + 'rpc/server/instance/service'
16
+ require lib + 'rpc/server/instance/peers'
16
17
 
17
18
  module RPC
18
19
  class Server
@@ -334,7 +335,7 @@ class Instance
334
335
  server.add_handler( 'options', @active_options )
335
336
 
336
337
  Cuboid::Application.application.instance_services.each do |name, service|
337
- service.include Server::Services::Base
338
+ service.include Server::Instance::Service
338
339
  si = service.new( name, self )
339
340
 
340
341
  Cuboid::Application.application.send :attr_reader, name
data/lib/version CHANGED
@@ -1 +1 @@
1
- 0.2.4.2
1
+ 0.2.6
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.2
4
+ version: 0.2.6
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-23 00:00:00.000000000 Z
11
+ date: 2023-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -296,9 +296,10 @@ 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
- - lib/cuboid/rpc/server/services/base.rb
302
303
  - lib/cuboid/ruby.rb
303
304
  - lib/cuboid/ruby/array.rb
304
305
  - lib/cuboid/ruby/hash.rb