Add post-spawn hook

This commit is contained in:
James Curtin
2018-05-04 19:56:34 -04:00
parent 10ea92dcea
commit 2f3f8d7826
4 changed files with 32 additions and 3 deletions

View File

@@ -25,8 +25,11 @@ Another use would be to copy initial content, such as tutorial files or referenc
You can define your own bootstrap process by implementing a `pre_spawn_hook` on any spawner.
The Spawner itself is passed as parameter to your hook and you can easily get the contextual information out of the spawning process.
If you implement a hook, make sure that it is *idempotent*. It will be executed every time
a notebook server is spawned to the user. That means you should somehow
Similarly, there may be cases where you would like to clean up after a spawner stops.
You may implement a `post_spawn_hook` that is always executed after the spawner stops.
If you implement a hook, make sure that it is *idempotent*. It will be executed every time
a notebook server is spawned to the user. That means you should somehow
ensure that things which should run only once are not running again and again.
For example, before you create a directory, check if it exists.