rflow 0.0.5 → 1.0.0a1

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +21 -0
  5. data/.yardopts +1 -0
  6. data/Gemfile +5 -1
  7. data/Guardfile +8 -0
  8. data/LICENSE +190 -0
  9. data/NOTES +26 -13
  10. data/README.md +448 -0
  11. data/Rakefile +5 -12
  12. data/bin/rflow +23 -20
  13. data/example/basic_config.rb +2 -2
  14. data/example/basic_extensions.rb +8 -8
  15. data/example/http_config.rb +1 -1
  16. data/example/http_extensions.rb +15 -15
  17. data/lib/rflow.rb +15 -387
  18. data/lib/rflow/component.rb +105 -50
  19. data/lib/rflow/component/port.rb +25 -24
  20. data/lib/rflow/components/raw.rb +4 -4
  21. data/lib/rflow/components/raw/extensions.rb +2 -2
  22. data/lib/rflow/configuration.rb +54 -36
  23. data/lib/rflow/configuration/component.rb +2 -3
  24. data/lib/rflow/configuration/connection.rb +9 -10
  25. data/lib/rflow/configuration/migrations/{20010101000001_create_settings.rb → 20010101000000_create_settings.rb} +2 -2
  26. data/lib/rflow/configuration/migrations/20010101000001_create_shards.rb +21 -0
  27. data/lib/rflow/configuration/migrations/20010101000002_create_components.rb +7 -2
  28. data/lib/rflow/configuration/migrations/20010101000003_create_ports.rb +3 -3
  29. data/lib/rflow/configuration/migrations/20010101000004_create_connections.rb +2 -2
  30. data/lib/rflow/configuration/port.rb +3 -4
  31. data/lib/rflow/configuration/ruby_dsl.rb +59 -35
  32. data/lib/rflow/configuration/setting.rb +8 -7
  33. data/lib/rflow/configuration/shard.rb +24 -0
  34. data/lib/rflow/configuration/uuid_keyed.rb +3 -3
  35. data/lib/rflow/connection.rb +21 -10
  36. data/lib/rflow/connections/zmq_connection.rb +45 -44
  37. data/lib/rflow/logger.rb +67 -0
  38. data/lib/rflow/master.rb +127 -0
  39. data/lib/rflow/message.rb +14 -14
  40. data/lib/rflow/pid_file.rb +84 -0
  41. data/lib/rflow/shard.rb +148 -0
  42. data/lib/rflow/version.rb +1 -1
  43. data/rflow.gemspec +22 -28
  44. data/schema/message.avsc +8 -8
  45. data/spec/fixtures/config_ints.rb +4 -4
  46. data/spec/fixtures/config_shards.rb +30 -0
  47. data/spec/fixtures/extensions_ints.rb +8 -8
  48. data/spec/rflow_component_port_spec.rb +58 -0
  49. data/spec/rflow_configuration_ruby_dsl_spec.rb +148 -0
  50. data/spec/rflow_configuration_spec.rb +4 -4
  51. data/spec/rflow_message_data_raw.rb +2 -2
  52. data/spec/rflow_message_data_spec.rb +6 -6
  53. data/spec/rflow_message_spec.rb +13 -13
  54. data/spec/rflow_spec.rb +294 -71
  55. data/spec/schema_spec.rb +2 -2
  56. data/spec/spec_helper.rb +6 -4
  57. data/temp.rb +21 -21
  58. metadata +56 -65
  59. data/.rvmrc +0 -1
  60. data/README +0 -0
@@ -22,7 +22,7 @@ describe 'RFlow::Message::Data::Raw Avro Schema' do
22
22
  p raw['raw'].encoding
23
23
 
24
24
  decoded_raw['raw'].should == raw['raw']
25
-
25
+
26
26
  end
27
-
27
+
28
28
  end
@@ -6,16 +6,18 @@ require 'log4r'
6
6
  RSpec.configure do |config|
7
7
  config.before(:all) do
8
8
  RFlow.logger = Log4r::Logger.new 'test'
9
- RFlow.logger.add Log4r::StdoutOutputter.new('test_stdout', :formatter => RFlow::LOG_PATTERN_FORMATTER)
9
+ RFlow.logger.add Log4r::StdoutOutputter.new('test_stdout', :formatter => RFlow::Logger::LOG_PATTERN_FORMATTER)
10
+ @base_temp_directory_path = File.join(File.dirname(__FILE__), 'tmp')
10
11
  end
11
12
 
12
13
  config.before(:each) do
13
- @temp_directory_path = File.expand_path(File.join(File.dirname(__FILE__), 'tmp'))
14
- Dir.mkdir @temp_directory_path
14
+ @entropy = Time.now.to_f.to_s
15
+ @temp_directory_path = File.expand_path(File.join(@base_temp_directory_path, @entropy))
16
+ FileUtils.mkdir_p @temp_directory_path
15
17
  end
16
18
 
17
19
  config.after(:each) do
18
- FileUtils.rm_rf @temp_directory_path
20
+ FileUtils.rm_rf @base_temp_directory_path
19
21
  end
20
22
  end
21
23
 
data/temp.rb CHANGED
@@ -40,8 +40,8 @@ class Message::Data
40
40
  end
41
41
 
42
42
  # Pointer to encapsulating message
43
- attr_accessor :message
44
-
43
+ attr_accessor :message
44
+
45
45
  def initialize(data_type_name, serialized_data=nil, schema_name=nil, schema_type=nil, schema=nil, message=nil)
46
46
  # schema_name ||= 'org.rflow.Messages.GenericStringMap'
47
47
  # schema_type ||= 'avro'
@@ -58,9 +58,9 @@ class Message::Data
58
58
  # registry register the schema?
59
59
  self.class.schema_registry.register(data_type_name, schema_name, schema_type, schema)
60
60
  else
61
-
61
+
62
62
  end
63
-
63
+
64
64
  end
65
65
 
66
66
  def self.create(data_type_name, data=nil, schema_name=nil, schema_type=nil, schema=nil)
@@ -102,9 +102,9 @@ class HTTPRequest < RFlow::Message::Data
102
102
  # figure out if you are being called with incompatible arguments,
103
103
  # i.e. schema stuff
104
104
  end
105
-
105
+
106
106
  end
107
-
107
+
108
108
  class Message
109
109
  # contains all definitions about what to do for a message
110
110
  # has a default Avro schema for a data type
@@ -113,7 +113,7 @@ class Message
113
113
  attr_accessor :data_class_registry
114
114
  end
115
115
 
116
-
116
+
117
117
  # Should load all the data stuff, perhaps to top level method on object
118
118
 
119
119
  attr_accessor :data_type_name, :provenance, :origination_context, :data_type_schema, :data
@@ -138,7 +138,7 @@ class Message
138
138
  end
139
139
  end
140
140
  end
141
-
141
+
142
142
  end
143
143
 
144
144
  class Port
@@ -174,8 +174,8 @@ class Component
174
174
  port_incidence = :single
175
175
  end
176
176
  @@input_ports[port_name] = InputPort.new port_name, port_incidence
177
- end
178
-
177
+ end
178
+
179
179
  def self.output_port
180
180
  # same as input port with different stuffs
181
181
  end
@@ -192,7 +192,7 @@ class Component
192
192
  :logger,
193
193
  :working_directory_path,
194
194
  }
195
-
195
+
196
196
  def initialize(config, run_directory)
197
197
  # configure component
198
198
  config = {
@@ -209,7 +209,7 @@ class Component
209
209
  out.send('stuff')
210
210
  another_out.send('more stuff')
211
211
  end
212
- # listen to
212
+ # listen to
213
213
  end
214
214
 
215
215
  def process_message(input_port, message)
@@ -219,7 +219,7 @@ class Component
219
219
  def receive_message(port)
220
220
  port.receive
221
221
  end
222
-
222
+
223
223
  def send_message(port, message)
224
224
  port.send(message)
225
225
  end
@@ -229,11 +229,11 @@ end
229
229
  class HTTPServer < RFlow::Component
230
230
  input_port :responses
231
231
  output_port :requests
232
-
232
+
233
233
  input_types "HTTP::Response"
234
234
  output_types "HTTP::Request"
235
235
 
236
-
236
+
237
237
  end
238
238
 
239
239
  class PassThrough < RFlow::Component
@@ -242,29 +242,29 @@ class PassThrough < RFlow::Component
242
242
  output_port :out
243
243
  output_port :another_out
244
244
 
245
- output_types
246
-
245
+ output_types
246
+
247
247
  def initialize(config, run_directory)
248
248
  # This will initialize the ports
249
249
  super
250
250
  # Do stuff to initialize component. Don't assume singleton
251
- end
251
+ end
252
252
 
253
253
 
254
254
  def process_message(input_port, data)
255
255
  out.send(message)
256
256
  another_out.send(message)
257
257
 
258
-
258
+
259
259
  end
260
260
 
261
261
  def process_data(input_port
262
-
262
+
263
263
  end
264
264
 
265
265
 
266
266
  class Transform < RFlow::Component
267
-
267
+
268
268
  end
269
269
 
270
270
  # Plugins:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 1.0.0a1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael L. Artz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-16 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuidtools
@@ -58,128 +58,100 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '3.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '3.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: avro
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 1.5.1
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 1.5.1
83
- - !ruby/object:Gem::Dependency
84
- name: ffi
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '1.0'
75
+ version: 1.7.5
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '1.0'
82
+ version: 1.7.5
97
83
  - !ruby/object:Gem::Dependency
98
- name: ffi-rzmq
84
+ name: em-zeromq
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '0.8'
89
+ version: 0.4.2
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: '0.8'
96
+ version: 0.4.2
111
97
  - !ruby/object:Gem::Dependency
112
- name: eventmachine
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: 1.0.0.beta3
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 1.0.0.beta3
125
- - !ruby/object:Gem::Dependency
126
- name: em-zeromq-mri
98
+ name: bundler
127
99
  requirement: !ruby/object:Gem::Requirement
128
100
  requirements:
129
101
  - - "~>"
130
102
  - !ruby/object:Gem::Version
131
- version: '0.2'
132
- type: :runtime
103
+ version: '1.5'
104
+ type: :development
133
105
  prerelease: false
134
106
  version_requirements: !ruby/object:Gem::Requirement
135
107
  requirements:
136
108
  - - "~>"
137
109
  - !ruby/object:Gem::Version
138
- version: '0.2'
110
+ version: '1.5'
139
111
  - !ruby/object:Gem::Dependency
140
- name: eventmachine_httpserver
112
+ name: rspec
141
113
  requirement: !ruby/object:Gem::Requirement
142
114
  requirements:
143
115
  - - "~>"
144
116
  - !ruby/object:Gem::Version
145
- version: '0.2'
146
- type: :runtime
117
+ version: '2.6'
118
+ type: :development
147
119
  prerelease: false
148
120
  version_requirements: !ruby/object:Gem::Requirement
149
121
  requirements:
150
122
  - - "~>"
151
123
  - !ruby/object:Gem::Version
152
- version: '0.2'
124
+ version: '2.6'
153
125
  - !ruby/object:Gem::Dependency
154
- name: rspec
126
+ name: rake
155
127
  requirement: !ruby/object:Gem::Requirement
156
128
  requirements:
157
- - - "~>"
129
+ - - ">="
158
130
  - !ruby/object:Gem::Version
159
- version: '2.6'
131
+ version: 0.8.7
160
132
  type: :development
161
133
  prerelease: false
162
134
  version_requirements: !ruby/object:Gem::Requirement
163
135
  requirements:
164
- - - "~>"
136
+ - - ">="
165
137
  - !ruby/object:Gem::Version
166
- version: '2.6'
138
+ version: 0.8.7
167
139
  - !ruby/object:Gem::Dependency
168
- name: rake
140
+ name: yard
169
141
  requirement: !ruby/object:Gem::Requirement
170
142
  requirements:
171
- - - ">="
143
+ - - "~>"
172
144
  - !ruby/object:Gem::Version
173
145
  version: 0.8.7
174
146
  type: :development
175
147
  prerelease: false
176
148
  version_requirements: !ruby/object:Gem::Requirement
177
149
  requirements:
178
- - - ">="
150
+ - - "~>"
179
151
  - !ruby/object:Gem::Version
180
152
  version: 0.8.7
181
- description: A Ruby-based workflow framework that utilizes ZeroMQ for component connections
182
- and Avro for serialization
153
+ description: A Ruby flow-based programming framework that utilizes ZeroMQ for component
154
+ connections and Avro for serialization
183
155
  email:
184
156
  - michael.artz@redjack.com
185
157
  executables:
@@ -188,10 +160,15 @@ extensions: []
188
160
  extra_rdoc_files: []
189
161
  files:
190
162
  - ".gitignore"
191
- - ".rvmrc"
163
+ - ".ruby-gemset"
164
+ - ".ruby-version"
165
+ - ".travis.yml"
166
+ - ".yardopts"
192
167
  - Gemfile
168
+ - Guardfile
169
+ - LICENSE
193
170
  - NOTES
194
- - README
171
+ - README.md
195
172
  - Rakefile
196
173
  - bin/rflow
197
174
  - example/basic_config.rb
@@ -207,26 +184,35 @@ files:
207
184
  - lib/rflow/configuration.rb
208
185
  - lib/rflow/configuration/component.rb
209
186
  - lib/rflow/configuration/connection.rb
210
- - lib/rflow/configuration/migrations/20010101000001_create_settings.rb
187
+ - lib/rflow/configuration/migrations/20010101000000_create_settings.rb
188
+ - lib/rflow/configuration/migrations/20010101000001_create_shards.rb
211
189
  - lib/rflow/configuration/migrations/20010101000002_create_components.rb
212
190
  - lib/rflow/configuration/migrations/20010101000003_create_ports.rb
213
191
  - lib/rflow/configuration/migrations/20010101000004_create_connections.rb
214
192
  - lib/rflow/configuration/port.rb
215
193
  - lib/rflow/configuration/ruby_dsl.rb
216
194
  - lib/rflow/configuration/setting.rb
195
+ - lib/rflow/configuration/shard.rb
217
196
  - lib/rflow/configuration/uuid_keyed.rb
218
197
  - lib/rflow/connection.rb
219
198
  - lib/rflow/connections.rb
220
199
  - lib/rflow/connections/zmq_connection.rb
200
+ - lib/rflow/logger.rb
201
+ - lib/rflow/master.rb
221
202
  - lib/rflow/message.rb
203
+ - lib/rflow/pid_file.rb
222
204
  - lib/rflow/port.rb
205
+ - lib/rflow/shard.rb
223
206
  - lib/rflow/util.rb
224
207
  - lib/rflow/version.rb
225
208
  - rflow.gemspec
226
209
  - schema/message.avsc
227
210
  - schema/raw.avsc
228
211
  - spec/fixtures/config_ints.rb
212
+ - spec/fixtures/config_shards.rb
229
213
  - spec/fixtures/extensions_ints.rb
214
+ - spec/rflow_component_port_spec.rb
215
+ - spec/rflow_configuration_ruby_dsl_spec.rb
230
216
  - spec/rflow_configuration_spec.rb
231
217
  - spec/rflow_message_data_raw.rb
232
218
  - spec/rflow_message_data_spec.rb
@@ -235,8 +221,9 @@ files:
235
221
  - spec/schema_spec.rb
236
222
  - spec/spec_helper.rb
237
223
  - temp.rb
238
- homepage: ''
239
- licenses: []
224
+ homepage: https://github.com/redjack/rflow
225
+ licenses:
226
+ - Apache-2.0
240
227
  metadata: {}
241
228
  post_install_message:
242
229
  rdoc_options: []
@@ -244,23 +231,26 @@ require_paths:
244
231
  - lib
245
232
  required_ruby_version: !ruby/object:Gem::Requirement
246
233
  requirements:
247
- - - "~>"
234
+ - - ">="
248
235
  - !ruby/object:Gem::Version
249
236
  version: '1.9'
250
237
  required_rubygems_version: !ruby/object:Gem::Requirement
251
238
  requirements:
252
- - - ">="
239
+ - - ">"
253
240
  - !ruby/object:Gem::Version
254
- version: '0'
241
+ version: 1.3.1
255
242
  requirements: []
256
- rubyforge_project: rflow
243
+ rubyforge_project:
257
244
  rubygems_version: 2.2.2
258
245
  signing_key:
259
246
  specification_version: 4
260
- summary: A Ruby-based workflow framework
247
+ summary: A Ruby flow-based programming framework
261
248
  test_files:
262
249
  - spec/fixtures/config_ints.rb
250
+ - spec/fixtures/config_shards.rb
263
251
  - spec/fixtures/extensions_ints.rb
252
+ - spec/rflow_component_port_spec.rb
253
+ - spec/rflow_configuration_ruby_dsl_spec.rb
264
254
  - spec/rflow_configuration_spec.rb
265
255
  - spec/rflow_message_data_raw.rb
266
256
  - spec/rflow_message_data_spec.rb
@@ -268,3 +258,4 @@ test_files:
268
258
  - spec/rflow_spec.rb
269
259
  - spec/schema_spec.rb
270
260
  - spec/spec_helper.rb
261
+ has_rdoc:
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm 1.9.2@rflow-devel
data/README DELETED
File without changes