babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
2021-06-23T05:10:53.162300Z

There were errors while compiling it. unable to create a binary from it

lispyclouds 2021-06-23T06:03:48.162500Z

How did you try to compile it @kspriyan31?

lispyclouds 2021-06-23T06:04:07.162700Z

just cloned and ran go build seems to compile for me

2021-06-23T06:19:42.162900Z

Did the same actually

lispyclouds 2021-06-23T06:22:51.163100Z

what errors do you see?

lispyclouds 2021-06-23T06:23:34.163300Z

also what's your go version?

2021-06-23T06:25:42.163500Z

# <http://gopkg.in/confluentinc/confluent-kafka-go.v1/kafka|gopkg.in/confluentinc/confluent-kafka-go.v1/kafka>
In file included from ..\..\go\pkg\mod\<http://gopkg.in|gopkg.in>\confluentinc\confluent-kafka-go.v1@v1.4.2\kafka\00version.go:24:
./librdkafka/rdkafka.h:83:10: fatal error: sys/socket.h: No such file or directory
   83 | #include &lt;sys/socket.h&gt; /* for sockaddr, .. */
      |          ^~~~~~~~~~~~~~
compilation terminated.

2021-06-23T06:25:46.163700Z

go version go1.16.5 windows/amd64

lispyclouds 2021-06-23T06:31:37.163900Z

so it seems librdkafka, the c lib powering the confluent connector isnt supported on windows

lispyclouds 2021-06-23T06:34:17.164100Z

could you try the steps mentioned here: https://github.com/confluentinc/confluent-kafka-go/issues/128

lispyclouds 2021-06-23T06:34:52.164400Z

basically you need to have MinGW gcc installed

lispyclouds 2021-06-23T06:35:04.164600Z

if thats there, the compile may work

lispyclouds 2021-06-23T06:35:33.164800Z

alternatively you could try using Windows Subsystem Linux

tzzh 2021-06-23T13:59:01.165Z

Hey guys yeah sorry there is no release as it's using CGO (ie C extensions for go) and so it's harder to cross compile it (I didn't know about the issues about confluent-kafka-go on windows but I guess that makes it even harder)

2021-06-23T14:50:30.168900Z

What's the best way to throttle the number of calls to an API in babashka? I have a sequence of calls to make from babashka to an API, but I'm not allowed to just (run! #(cmd! %) command-collection) because the server will deny my calls if I execute them too fast. What's the best way to interleave my commands with something like a pause for x milliseconds?

lispyclouds 2021-06-23T14:57:13.169400Z

off the top of my head 😛 (interleave [call1 call2 ...] (cycle [#(Thread/sleep 1000)]))

2021-06-23T14:58:37.169700Z

Nice ... going to try that 🤓

2021-06-23T15:03:21.170Z

Yep, with a slight variation to fit my context, it works, thanks!

2😄
borkdude 2021-06-23T15:14:12.170300Z

@thomas.ormezzano We have a pod which is using CGO here: https://github.com/babashka/pod-babashka-go-sqlite3 If you want, you can copy the configs :)

tzzh 2021-06-23T15:44:21.170800Z

nice, thanks 🙂 I'll try to take a look when I have a bit more time