-
Notifications
You must be signed in to change notification settings - Fork 58
Andrew/issue 383 fix hang #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7918d63
Readd missing argument
ayjayt 0f1dc31
Add quiet start/stop with automatic stop atexit.
ayjayt b0ba305
Add new functions to init.
ayjayt 3a1bbdb
Merge branch 'master' into andrew/issue-383-fix-hang
ayjayt 62a4edd
Add silence_warnings argument to sync_server
ayjayt d9f8504
Remove old safe API
ayjayt 775f5a1
Merge branch 'master' into andrew/issue-383-fix-hang
ayjayt 32a0c2e
Revert "Remove old safe API"
ayjayt 6aaf572
Fix bad API/docs
ayjayt 25f6595
Move __all__ to top
ayjayt ad58bbf
Accept kwarg silence_warnings explicitly in sig
ayjayt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -15,20 +15,44 @@ | |
| _global_server = _sync_server.GlobalKaleidoServer() | ||
|
|
||
|
|
||
| def start_sync_server(*args, **kwargs): | ||
| def safe_start_sync_server(*args, **kwargs): | ||
| """ | ||
| Start a kaleido server which will process all sync generation requests. | ||
|
|
||
| Only one server can be started at a time. | ||
| The kaleido server is a singleton, so it can't be opened twice. This | ||
| function will simply return if the server is already running. | ||
|
|
||
| This wrapper function takes the exact same arguments as kaleido.Kaleido(), | ||
| except one extra, `silence_warnings`. | ||
|
|
||
| Args: | ||
| *args: all arguments `Kaleido()` would take. | ||
| silence_warnings: (bool, default False): If True, emit warning if | ||
| starting an already started server. | ||
| **kwargs: all keyword arguments `Kaleido()` would take. | ||
|
|
||
| This wrapper function takes the exact same arguments as kaleido.Kaleido(). | ||
| """ | ||
| _global_server.open(*args, **kwargs) | ||
| _global_server.ensure_opened(*args, **kwargs) | ||
|
|
||
|
|
||
| def stop_sync_server(): | ||
| """Stop the kaleido server. It can be restarted.""" | ||
| _global_server.close() | ||
| def start_sync_server(*args, **kwargs): | ||
| """ | ||
| Start a kaleido server which will process all sync generation requests. | ||
|
|
||
| The kaleido server is a singleton, so it can't be opened twice. This | ||
| function will warn you if the server is already running. | ||
|
|
||
| This wrapper function takes the exact same arguments as kaleido.Kaleido(), | ||
| except one extra, `silence_warnings`. | ||
|
|
||
| Args: | ||
| *args: all arguments `Kaleido()` would take. | ||
| silence_warnings: (bool, default False): If True, emit warning if | ||
| starting an already started server. | ||
| **kwargs: all keyword arguments `Kaleido()` would take. | ||
|
|
||
| """ | ||
| _global_server.open(*args, **kwargs) | ||
|
|
||
|
|
||
| __all__ = [ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style nit: this should be at the top |
||
|
|
||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayjayt This function can be completely removed now, right? And where is
stop_sync_server()?