-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from DataDog/anmarchenko/git_tree_upload_worker
- Loading branch information
Showing
20 changed files
with
284 additions
and
12 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
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,35 @@ | ||
# frozen_string_literal: true | ||
|
||
require "datadog/core/worker" | ||
require "datadog/core/workers/async" | ||
|
||
# general purpose async worker for CI | ||
# executes given task once in separate thread | ||
module Datadog | ||
module CI | ||
class Worker < Datadog::Core::Worker | ||
include Datadog::Core::Workers::Async::Thread | ||
|
||
DEFAULT_SHUTDOWN_TIMEOUT = 60 | ||
DEFAULT_WAIT_TIMEOUT = 60 | ||
|
||
def stop(timeout = DEFAULT_SHUTDOWN_TIMEOUT) | ||
join(timeout) | ||
end | ||
|
||
def wait_until_done(timeout = DEFAULT_WAIT_TIMEOUT) | ||
join(timeout) | ||
end | ||
|
||
def done? | ||
started? && !running? | ||
end | ||
end | ||
|
||
class DummyWorker < Worker | ||
def initialize | ||
super { nil } | ||
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
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,22 @@ | ||
module Datadog | ||
module CI | ||
class Worker < Datadog::Core::Worker | ||
include Datadog::Core::Workers::Async::Thread::PrependedMethods | ||
include Datadog::Core::Workers::Async::Thread | ||
|
||
DEFAULT_SHUTDOWN_TIMEOUT: 60 | ||
|
||
DEFAULT_WAIT_TIMEOUT: 60 | ||
|
||
def stop: (?Integer timeout) -> void | ||
|
||
def wait_until_done: (?Integer timeout) -> void | ||
|
||
def done?: () -> bool | ||
end | ||
|
||
class DummyWorker < Worker | ||
def initialize: () -> void | ||
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.