-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed ThreadScheduler as normal requirement
Some environments could have threading disabled, and therefore the threading import can resolve in an error. This commit fixes that :)
- Loading branch information
1 parent
b2963d2
commit d140b8e
Showing
3 changed files
with
12 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
from threading import Thread | ||
|
||
|
||
class SyncScheduler(object): | ||
def call(self, fn): | ||
try: | ||
fn() | ||
except: | ||
pass | ||
|
||
|
||
class ThreadScheduler(object): | ||
def call(self, fn): | ||
thread = Thread(target=fn) | ||
thread.start() |
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,7 @@ | ||
from threading import Thread | ||
|
||
|
||
class ThreadScheduler(object): | ||
def call(self, fn): | ||
thread = Thread(target=fn) | ||
thread.start() |