Fork me on GitHub
#code-reviews
<
2019-11-01
>
hiredman03:11:25

I would make some kind of sqs object with the only operation being given a queue and a callback, pull from the queue and hand messages to the callback, and then other code can register itself to handle messages more flexibly then using the defmulti approach. I might implement that by implementing the Pub protocol from core.async where sqs queue names would be topics, but getting that to work correctly (stop pulling messages when there are no subscriptions) could be tricky so I might leave out the protocol

tdantas08:11:02

Hey @U0NCTKEV8 , I like the callback idea . How can I do that ? Can’t seeing how to do . Correct me if I’m wrong Sqs record which implement the QueueProtocol , right ? Would love to see how register callback as you said instead of multi methods

tdantas09:11:29

Could you provide a small example how to do that ?

tdantas11:11:26

wrote the gist with the code to make it easy the reading -> https://gist.github.com/tdantas/f092564ac6a902bbf01d1ab9f228791a