Created
          March 7, 2025 16:04 
        
      - 
      
- 
        Save thomascothran/c6580d503fdc98ca2a4cf99cd83447cf to your computer and use it in GitHub Desktop. 
Revisions
- 
        thomascothran created this gist Mar 7, 2025 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ {:paths ["."]} 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ ;; --------------------------------------------------------- ;; Mulog Custom Publishers ;; - tap publisher for use with Portal and other tap sources ;; h/t Practicalli - https://practical.li/clojure/data-inspector/portal/#tap-logs-to-portal ;; --------------------------------------------------------- (ns tap-publisher (:require [com.brunobonacci.mulog.buffer :as mulog-buffer] [portal.api :as p])) (deftype TapPublisher [buffer transform] com.brunobonacci.mulog.publisher.PPublisher (agent-buffer [_] buffer) (publish-delay [_] 200) (publish [_ buffer] (doseq [item (transform (map second (mulog-buffer/items buffer)))] (tap> item)) (mulog-buffer/clear buffer))) (defn tap [{:keys [transform] :as _config}] (TapPublisher. (mulog-buffer/agent-buffer 10000) (or transform identity)))