portal

Stephan Renatus 2023-03-21T19:39:23.960339Z

heya. I’m stuck while playing with bb and portal. everything looks cool but it doesn’t work — see https://gist.github.com/srenatus/6736c5d43fe8f8321ac7107216edd92e for bb.edn, the log of the terminal controlling portal; and the script I’d like to have send a thing to portal via the remote API, from another terminal. The script produces no output (no errors), but the portal window also stays empty. I feel like I’m missing something basic here 😳

✅ 1
Stephan Renatus 2023-03-22T08:34:38.281629Z

it works! thanks a lot

djblue 2023-03-21T22:31:52.523309Z

Ohh, the issue here is that tap> is processed asynchronously via a queue. So the process dies before the tap handler even gets called. For this use case, you can also call the submit fn directly instead 👌

djblue 2023-03-21T22:33:16.015509Z

#!/usr/bin/env bb
(require '[portal.client.jvm :as p])

(def submit (partial p/submit {:port 5678}))

(submit "up and running")