Introduce ServerKernelManager class #15
Closed
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.
Per this comment/response, this pull request introduces a
ServerKernelManager
class which is instantiated by default within theAsyncMappingKernelManager
for each managed instance. Currently,ServerKernelManager
derives from jupyter_client'sAsyncIOLoopKernelManager
, thereby preserving existing functionality.Introducing this class allows the Server to use this implementation to provide server-specific functionality like kernel-based events, the potential for highly available kernels, etc., and re-enforces the notion that the
KernelManager
class (and corresponding functionality) is the purview of the application.Applications bringing their own subclass of
AsyncIOLoopKernelManager
should update their implementations to derive fromServerKernelManager
or risk missing functionality that ultimately is associated withServerKernelManager
.With this PR the activity-tracking attributes that were previously patched onto the current instance are formally defined traits. As a result, the
execution_state
's initial value is "initializing", which will be set to "starting" upon the completion of thestart_kernel()
method. If this complicates state management too much, we can have the initial state be "starting", but I felt "initializing" was more correct.Note that this PR does NOT introduce a similarly named class relative to
MappingKernelManager
. This simplifies support and serves as an impetus for applications/server extensions to switch to using the async kernel management.