sumac 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +2 -0
- data/lib/core_extensions.rb +207 -0
- data/lib/sumac.rb +94 -0
- data/lib/sumac/adapter.rb +5 -0
- data/lib/sumac/adapter/closed.rb +7 -0
- data/lib/sumac/argument_error.rb +5 -0
- data/lib/sumac/call_dispatcher.rb +70 -0
- data/lib/sumac/call_processor.rb +93 -0
- data/lib/sumac/closed_error.rb +5 -0
- data/lib/sumac/closer.rb +53 -0
- data/lib/sumac/connection.rb +94 -0
- data/lib/sumac/exposed_object.rb +131 -0
- data/lib/sumac/exposed_object_child.rb +158 -0
- data/lib/sumac/forgoten.rb +5 -0
- data/lib/sumac/handshake.rb +48 -0
- data/lib/sumac/id_allocator.rb +99 -0
- data/lib/sumac/local_reference.rb +16 -0
- data/lib/sumac/local_references.rb +80 -0
- data/lib/sumac/message.rb +19 -0
- data/lib/sumac/message/exchange.rb +30 -0
- data/lib/sumac/message/exchange/base.rb +15 -0
- data/lib/sumac/message/exchange/call_request.rb +96 -0
- data/lib/sumac/message/exchange/call_response.rb +83 -0
- data/lib/sumac/message/exchange/compatibility_notification.rb +53 -0
- data/lib/sumac/message/exchange/forget_notification.rb +77 -0
- data/lib/sumac/message/exchange/id.rb +30 -0
- data/lib/sumac/message/exchange/initialization_notification.rb +52 -0
- data/lib/sumac/message/exchange/notification.rb +9 -0
- data/lib/sumac/message/exchange/shutdown_notification.rb +27 -0
- data/lib/sumac/message/object.rb +72 -0
- data/lib/sumac/message/object/array.rb +57 -0
- data/lib/sumac/message/object/base.rb +21 -0
- data/lib/sumac/message/object/boolean.rb +45 -0
- data/lib/sumac/message/object/exception.rb +66 -0
- data/lib/sumac/message/object/exposed.rb +79 -0
- data/lib/sumac/message/object/exposed_child.rb +86 -0
- data/lib/sumac/message/object/float.rb +45 -0
- data/lib/sumac/message/object/hash_table.rb +75 -0
- data/lib/sumac/message/object/integer.rb +45 -0
- data/lib/sumac/message/object/native_exception.rb +56 -0
- data/lib/sumac/message/object/null.rb +44 -0
- data/lib/sumac/message/object/string.rb +45 -0
- data/lib/sumac/message_error.rb +5 -0
- data/lib/sumac/messenger.rb +65 -0
- data/lib/sumac/native_error.rb +17 -0
- data/lib/sumac/no_method_error.rb +9 -0
- data/lib/sumac/reference.rb +68 -0
- data/lib/sumac/remote_entry.rb +42 -0
- data/lib/sumac/remote_object.rb +39 -0
- data/lib/sumac/remote_object_child.rb +38 -0
- data/lib/sumac/remote_reference.rb +16 -0
- data/lib/sumac/remote_references.rb +70 -0
- data/lib/sumac/scheduler.rb +56 -0
- data/lib/sumac/shutdown.rb +32 -0
- data/lib/sumac/stale_object_error.rb +5 -0
- data/lib/sumac/unexposable_object_error.rb +9 -0
- data/lib/sumac/worker_pool.rb +35 -0
- data/test/test_id_allocator.rb +25 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 48b4334807f802e50718e6d28904116f16b08d2c
|
4
|
+
data.tar.gz: 32efc3f54afd2450f4992e53f74d47b98c75e0ec
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 65e0753fe96b1bd658dc9cf4a02bee736ae5e7a3856673dd829b87f2e27248aeeaaf0ee37dc39cee58f23261199391e2846337b453b625253f20112226995f82
|
7
|
+
data.tar.gz: f84c32e695888ffc6b37f543037d07608377b4c5dcd7dc864a0ba161d69150525e2b690c154f3a602decdeb08f57c3a9fb581215c127e47cd35e60ee5a026a94
|
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
# Rob Fors
|
2
|
+
# 20160105
|
3
|
+
# core extensions I found useful
|
4
|
+
|
5
|
+
class Object
|
6
|
+
def not_nil?
|
7
|
+
!nil?
|
8
|
+
end
|
9
|
+
|
10
|
+
def as
|
11
|
+
yield self
|
12
|
+
end
|
13
|
+
|
14
|
+
def true?
|
15
|
+
self == true
|
16
|
+
end
|
17
|
+
|
18
|
+
def false?
|
19
|
+
self == false
|
20
|
+
end
|
21
|
+
|
22
|
+
def is_not_a? klass
|
23
|
+
!is_a?(klass)
|
24
|
+
end
|
25
|
+
|
26
|
+
def in?(arg)
|
27
|
+
arg.include?(self)
|
28
|
+
end
|
29
|
+
|
30
|
+
def one_of?(*args)
|
31
|
+
args.include?(self)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
class Numeric
|
38
|
+
def positive?
|
39
|
+
self > 0
|
40
|
+
end
|
41
|
+
|
42
|
+
def negative?
|
43
|
+
self < 0
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
class Array
|
49
|
+
def uniq?
|
50
|
+
length == uniq.length
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_h
|
54
|
+
Hash[self]
|
55
|
+
end
|
56
|
+
|
57
|
+
def swap_indexes(a,b)
|
58
|
+
temp = self.dup
|
59
|
+
temp[a], temp[b] = temp[b], temp[a]
|
60
|
+
temp
|
61
|
+
end
|
62
|
+
|
63
|
+
def swap_indexes!(a,b)
|
64
|
+
self[a], self[b] = self[b], self[a]
|
65
|
+
self
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
module Enumerable
|
70
|
+
def exclude?(element)
|
71
|
+
!include?(element)
|
72
|
+
end
|
73
|
+
|
74
|
+
def find_element(element)
|
75
|
+
find { |i| i == element }
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
class Hash
|
81
|
+
def + (otherHash)
|
82
|
+
merge(otherHash) { |key, v1, v2| [v1,v2] }
|
83
|
+
end
|
84
|
+
|
85
|
+
def consolidate(otherHash)
|
86
|
+
(keys + otherHash.keys).map { |key| [key, [self[key], otherHash[key]]] }.to_h
|
87
|
+
end
|
88
|
+
|
89
|
+
def include_hash?(other)
|
90
|
+
other.all? do |other_key_value|
|
91
|
+
any? { |own_key_value| own_key_value == other_key_value }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def symbolize_keys
|
96
|
+
self.map { |k,v| [k.to_sym, v] }.to_h
|
97
|
+
end
|
98
|
+
|
99
|
+
def symbolize_keys!
|
100
|
+
self.map! { |k,v| [k.to_sym, v] }.to_h
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
class File
|
106
|
+
def self.append(path, text)
|
107
|
+
open(path, 'a') { |f| f.write text }
|
108
|
+
end
|
109
|
+
|
110
|
+
def self.append_line(path, text)
|
111
|
+
open(path, 'a') do |f|
|
112
|
+
f.write(text)
|
113
|
+
f.puts
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.shared_read(path)
|
118
|
+
open(path, 'r') do |f|
|
119
|
+
f.flock(File::LOCK_SH)
|
120
|
+
f.read
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def self.exclusive_read(path)
|
125
|
+
open(path, 'r') do |f|
|
126
|
+
f.flock(File::LOCK_EX)
|
127
|
+
f.read
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.exclusive_write(path, string)
|
132
|
+
open(path, 'a+') do |f|
|
133
|
+
f.flock(File::LOCK_EX)
|
134
|
+
f.rewind
|
135
|
+
f.write(string)
|
136
|
+
f.flush
|
137
|
+
f.truncate(f.pos)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.exclusive_modify(path)
|
142
|
+
open(path, 'a+') do |f|
|
143
|
+
f.flock(File::LOCK_EX)
|
144
|
+
f.rewind
|
145
|
+
string = yield f.read
|
146
|
+
f.rewind
|
147
|
+
f.write(string)
|
148
|
+
f.flush
|
149
|
+
f.truncate(f.pos)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def self.exclusive_append(path)
|
154
|
+
open(path, 'a+') do |f|
|
155
|
+
f.flock(File::LOCK_EX)
|
156
|
+
f.rewind
|
157
|
+
string = yield f.read
|
158
|
+
f.write(string)
|
159
|
+
f.flush
|
160
|
+
f.truncate(f.pos)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
|
166
|
+
class MatchData
|
167
|
+
def to_h
|
168
|
+
names.zip(captures).to_h
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
|
173
|
+
class NilClass
|
174
|
+
def to_h
|
175
|
+
{}
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
|
180
|
+
module JSON
|
181
|
+
def self.validate(string)
|
182
|
+
begin
|
183
|
+
JSON.parse(string)
|
184
|
+
true
|
185
|
+
rescue JSON::ParserError => e
|
186
|
+
false
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
class Proc
|
193
|
+
def self.to_lambda(block)
|
194
|
+
raise 'argument is not a Proc' unless block.is_a?(Proc)
|
195
|
+
if RUBY_ENGINE && RUBY_ENGINE == "jruby"
|
196
|
+
return lambda(&block)
|
197
|
+
else
|
198
|
+
obj = Object.new
|
199
|
+
obj.define_singleton_method(:_, &block)
|
200
|
+
return obj.method(:_).to_proc
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def to_lambda
|
205
|
+
self.class.to_lambda(self)
|
206
|
+
end
|
207
|
+
end
|
data/lib/sumac.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'socket'
|
2
|
+
require 'pry'
|
3
|
+
require 'json'
|
4
|
+
require 'thread'
|
5
|
+
require 'quack_concurrency'
|
6
|
+
require 'queued_state_machine'
|
7
|
+
require 'emittable'
|
8
|
+
|
9
|
+
require_relative "core_extensions.rb"
|
10
|
+
|
11
|
+
require_relative "sumac/adapter.rb"
|
12
|
+
require_relative "sumac/adapter/closed.rb"
|
13
|
+
require_relative "sumac/argument_error.rb"
|
14
|
+
require_relative "sumac/call_dispatcher.rb"
|
15
|
+
require_relative "sumac/call_processor.rb"
|
16
|
+
require_relative "sumac/closed_error.rb"
|
17
|
+
require_relative "sumac/closer.rb"
|
18
|
+
require_relative "sumac/connection.rb"
|
19
|
+
require_relative "sumac/exposed_object.rb"
|
20
|
+
require_relative "sumac/exposed_object_child.rb"
|
21
|
+
require_relative "sumac/handshake.rb"
|
22
|
+
require_relative "sumac/id_allocator.rb"
|
23
|
+
require_relative "sumac/reference.rb"
|
24
|
+
require_relative "sumac/local_reference.rb"
|
25
|
+
require_relative "sumac/local_references.rb"
|
26
|
+
require_relative "sumac/message.rb"
|
27
|
+
require_relative "sumac/message/exchange.rb"
|
28
|
+
require_relative "sumac/message/object.rb"
|
29
|
+
require_relative "sumac/message/exchange/id.rb"
|
30
|
+
require_relative "sumac/message/exchange/base.rb"
|
31
|
+
require_relative "sumac/message/exchange/call_request.rb"
|
32
|
+
require_relative "sumac/message/exchange/call_response.rb"
|
33
|
+
require_relative "sumac/message/exchange/notification.rb"
|
34
|
+
require_relative "sumac/message/exchange/compatibility_notification.rb"
|
35
|
+
require_relative "sumac/message/exchange/forget_notification.rb"
|
36
|
+
require_relative "sumac/message/exchange/initialization_notification.rb"
|
37
|
+
require_relative "sumac/message/exchange/shutdown_notification.rb"
|
38
|
+
require_relative "sumac/message/object/base.rb"
|
39
|
+
require_relative "sumac/message/object/array.rb"
|
40
|
+
require_relative "sumac/message/object/boolean.rb"
|
41
|
+
require_relative "sumac/message/object/exception.rb"
|
42
|
+
require_relative "sumac/message/object/exposed.rb"
|
43
|
+
require_relative "sumac/message/object/exposed_child.rb"
|
44
|
+
require_relative "sumac/message/object/float.rb"
|
45
|
+
require_relative "sumac/message/object/hash_table.rb"
|
46
|
+
require_relative "sumac/message/object/integer.rb"
|
47
|
+
require_relative "sumac/message/object/native_exception.rb"
|
48
|
+
require_relative "sumac/message/object/null.rb"
|
49
|
+
require_relative "sumac/message/object/string.rb"
|
50
|
+
require_relative "sumac/message_error.rb"
|
51
|
+
require_relative "sumac/messenger.rb"
|
52
|
+
require_relative "sumac/no_method_error.rb"
|
53
|
+
require_relative "sumac/native_error.rb"
|
54
|
+
require_relative "sumac/remote_entry.rb"
|
55
|
+
require_relative "sumac/remote_object.rb"
|
56
|
+
require_relative "sumac/remote_object_child.rb"
|
57
|
+
require_relative "sumac/remote_reference.rb"
|
58
|
+
require_relative "sumac/remote_references.rb"
|
59
|
+
require_relative "sumac/scheduler.rb"
|
60
|
+
require_relative "sumac/shutdown.rb"
|
61
|
+
require_relative "sumac/stale_object_error.rb"
|
62
|
+
require_relative "sumac/unexposable_object_error.rb"
|
63
|
+
require_relative "sumac/worker_pool.rb"
|
64
|
+
|
65
|
+
|
66
|
+
class Sumac
|
67
|
+
include Emittable
|
68
|
+
|
69
|
+
def initialize(duck_types: {}, entry: nil, messenger: , workers: 1)
|
70
|
+
@connection = Connection.new(self, duck_types: duck_types, entry: entry, messenger: messenger, workers: workers)
|
71
|
+
@connection.scheduler.run
|
72
|
+
end
|
73
|
+
|
74
|
+
def close
|
75
|
+
@connection.closer.close
|
76
|
+
nil
|
77
|
+
end
|
78
|
+
|
79
|
+
def entry
|
80
|
+
@connection.remote_entry.get
|
81
|
+
end
|
82
|
+
|
83
|
+
def join
|
84
|
+
@connection.closer.join
|
85
|
+
end
|
86
|
+
|
87
|
+
#def forget(exposed_object)
|
88
|
+
# raise unless exposed_object.is_a?(ExposedObject)
|
89
|
+
# @connection
|
90
|
+
|
91
|
+
#def kill
|
92
|
+
#end
|
93
|
+
|
94
|
+
end
|