-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to shutdown the client cleanly.
- ToggleFetcher updates the backup client in an atomic operation - Improved locking in ToggleFetcher when saving to disk - Keep track of threads in ScheduledExecutor - Added unit tests for ScheduledExecutor - Improved documentation
- Loading branch information
Showing
7 changed files
with
109 additions
and
36 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,18 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe Unleash::ScheduledExecutor do | ||
# context 'parameters correctly assigned in initialization' | ||
it "can start and exit a thread" do | ||
scheduled_executor = Unleash::ScheduledExecutor.new('TesterLoop', 0.1) | ||
scheduled_executor.run do | ||
loop do | ||
sleep 0.1 | ||
end | ||
end | ||
|
||
expect(scheduled_executor.running?).to be true | ||
scheduled_executor.exit | ||
scheduled_executor.thread.join | ||
expect(scheduled_executor.running?).to be false | ||
end | ||
end |