Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remote_job_runner became job_runner. Moved all job running behaviour …
…into job. Hooks are run before jobs git-svn-id: http://rspec-ext.rubyforge.org/svn/distributed/branches/multi_transport@37 b9fc4567-813f-4f01-94b2-355dee807878
- Loading branch information
Showing
24 changed files
with
474 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module Spec | ||
module Distributed | ||
class JobRunner | ||
def initialize(options) | ||
@options = options | ||
end | ||
|
||
def run | ||
prepare | ||
begin | ||
next_job | ||
run_job | ||
publish_result | ||
end while keep_running? | ||
end | ||
|
||
def prepare | ||
#transport_manager.start_local_server_if_required_or_somesuch | ||
transport_manager.connect(true) | ||
end | ||
|
||
def next_job | ||
@job = transport_manager.next_job | ||
end | ||
|
||
def run_job | ||
@job.run # options? | ||
end | ||
|
||
def publish_result | ||
Marshal.dump(@job) # safety check for now. Don't need any | ||
# remote references | ||
transport_manager.publish_result(@job) | ||
end | ||
|
||
def keep_running? | ||
true | ||
end | ||
|
||
protected | ||
def transport_manager | ||
@options.transport_manager | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.