Fork me on GitHub
#clojure-europe
<
2022-10-31
>
reefersleep08:10:00

Good morning!

thomas09:10:47

Good morning

simongray09:10:53

good morning

Jakub Holý (HolyJak)09:10:01

Morning! Today I continue to hack Portal to make it do my biding https://clojurians.slack.com/archives/C0185BFLLSE/p1667162340334979

lemontea17:11:40

by submit you mean the remote API of portal?

Jakub Holý (HolyJak)17:11:45

No, I mean portal.api/submit

Jakub Holý (HolyJak)17:11:31

yes, the same portal.api/submit thart you normally use with add-tap

lemontea17:11:33

I see… so there’s still a prod repl underneath, it’s just that it is “enhanced” with remote access through nrepl + all the goodies (including but not limited to visualization) provided by portal, do I understand it correctly?

lemontea17:11:46

(when I first read this and don’t know anything about portal, my first thought is how in the kubernetes ecosystem some repl-like ideas are getting more accepted. Like providing one-click terminal access to a running pod)

Jakub Holý (HolyJak)17:11:57

No, there is no repl. Portal works without repl.

lemontea18:11:11

huh… so where is the portal instance located? embedded right inside the prod app? and say the prod app run portal.api/url and print it to the server log…

lemontea18:11:41

because right now, even after briefly reading through the doc, the details of how everything work is still highly fuzzy to me

lemontea18:11:27

on a positive spin - maybe that’s an opportunity to write a blog post clarifying/explaining stuff 😅

Jakub Holý (HolyJak)22:11:57

> where is the portal instance located? embedded right inside the prod app? exactly. Portal runs its own http server, on a dedicated port, serving its ui. This is the key part of integrating it into the prod app (`p` is portal.api, p.rt is portal.runtime):

(defrecord TroubleshootingPortal [config postgres-service]
  component/Lifecycle
  (start [component]
    (p.rt/register! #'drilldown!
                    {:predicate #(-> % :ardoq :entity-type #{:report})})
    (p/set-defaults! {:value (atom (list
                                     (with-meta (postgres-service/list-existing-org-dbs postgres-service)
                                                {`ccp/nav nav-org-label})))})
    (assoc component
      :server (:http-server (p/start {:port 8989})))) 
  (stop [{:keys [^org.httpkit.server.HttpServer server] :as component}]
    (p/close :all)
    (some-> server (.stop 10))
    (dissoc component :server)))
BTW I have replaced the aforementioned submit with set-defaults! shown above.

reefersleep11:10:44

Trying to get started programming with my voice using Talon. The voice engine does not like my accent/mic, but it feels amazing to free my hands of the keyboard/mouse/desk, so I think I’ll keep stumbling till I get there 🙂

💬 4
reefersleep14:10:43

experiencing about the same success 😄

lemontea14:10:55

an asynchronous good morning! …

lemontea14:10:06

… messages from the backlog