notebook icon indicating copy to clipboard operation
notebook copied to clipboard

shutdown notebook app for libary usecase

Open awb99 opened this issue 5 years ago • 1 comments

for library usecase we need shutdown routine; always shutting down an reloading repl is annoying. this is how we use it in tradeg:

(ns notebook.main
  (:require
   [clojure.core.async :refer [thread]]
   [pinkgorilla.notebook-app.cli :refer [parse-opts]]
   [pinkgorilla.notebook-app.core :refer [run-gorilla-server]])
  (:gen-class))

(defn run-notebook []
  (let [args2 ["-c" "./profiles/notebook/config.edn"]
        {:keys [options]} (parse-opts args2)]
    (println "Options Are: " options)
    (run-gorilla-server options)
    nil))

(defn start []
  (thread
   (run-notebook)))

;; the notebook secret management 
;; currently expects ./test/creds.edn file
;; for security, this file is excluded from git

(defn -main [& args]
  (println "Running PinkGorilla Notebook")
  (run-notebook))

(comment
  (run-notebook)

  ;comment end
  )

awb99 avatar Apr 04 '20 00:04 awb99

this is still relevant in new version

awb99 avatar May 10 '21 23:05 awb99