Fork me on GitHub
#portal
<
2023-03-21
>
Stephan Renatus19:03:23

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 😳

2
djblue22:03:52

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 👌

djblue22:03:16

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

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

(submit "up and running")

Stephan Renatus08:03:38

it works! thanks a lot