Fork me on GitHub
#clojure
<
2021-11-21
>
borkdude12:11:15

What does this part in the doc of read mean?

:eof - on eof, return value unless :eofthrow, then throw.
           if not specified, will throw
user=> (with-in-str "" (read {:eof ::eof :eofthrow true} *in*))
:user/eof

borkdude12:11:55

oh got it. facepalm

user=> (with-in-str "" (read {:eof :eofthrow} *in*))
Execution error at user/eval159 (REPL:1).
EOF while reading

emccue20:11:33

queues locally - how do? Want to use SQS in prod but something less internet requiring locally.

pavlosmelissinos20:11:01

We've used https://github.com/localstack/localstack a bit at work to mock AWS stuff.

pavlosmelissinos20:11:02

It has worked pretty well for us. All you have to do is change your endpoint URLs, other than that the APIs are the same.

hiredman20:11:46

Depends exactly what functionality you want locally

☝️ 1
hiredman20:11:35

If you just literally want a queue in tests, java util concurrent has good blocking queues

hiredman20:11:18

If you want something like a message bus, apache Artemis can be run standalone or embedded in your app jvm (https://activemq.apache.org/components/artemis/documentation/1.0.0/embedding-activemq.html)

emccue21:11:28

Are there any examples of using the JMS api for that stuff?

Ben Sless04:11:05

Wrap the operations you need in a protocol, use an instance of of a java queue in dev time like hiredman said

emccue04:11:01

I was (and am) hoping “JMS” or something else standard would be that protocol

Ben Sless06:11:20

I was thinking of even something slightly more generalized and purely behavioral. Once upon a time I toyed around with implementing a generic interface over queues (and implementing it for Kafka, Artemis, core.async, etc) but felt like I was trying to round the circle a bit, so I stopped

emccue06:11:26

oh nvm JMS is a Java EE thing

emccue06:11:33

welp, custom protocol it is. That or localstack/similar