Fork me on GitHub
#beginners
<
2016-06-27
>
tungsten00:06:05

I am having a hard time writing a UDP client. I want to receive packets, ACK them and get to the next packet. my current problem is that my while loop is not getting to the next packet for some reason. Wireshark shows the server sent it. Code here: https://bitbucket.org/briangorman2/tftp/src/53fdd91eac2c13da9c777d555276f0da31d4b470/src/tftp_client/core.clj?at=master&amp;fileviewer=file-view-default

tungsten02:06:20

Sorry - my problematic code is actually here

smnplk03:06:23

@bfast: cant get to your code, it's private

andreas-thoelke05:06:40

Thanks @danlebrero ! What I was searching for!

jindrichm09:06:21

Why do I get No such var: clojure.core/–> when I use this macro?

(defmacro macrotest [form]  `(clojure.core/–> {} ~form))

smnplk16:06:40

I'm learnign about core.async. I know that thread macro creates a real OS thread, but what does go block do on JVM. I know that on javascript runtime, it jsut converts operations to a state machine, but I 've read somewhere that go blocks on jvm use threads from thread pool ?

smnplk16:06:24

Ahh..so basically my question is really about thread pooling vs using many single threads.

smnplk16:06:27

need to read that java concurrency book that Rich was talking about.

Alex Miller (Clojure team)17:06:25

@smnplk: yes, go blocks are multiplexed over an internal thread pool. when no async op can be satisfied, the go block is “parked” and not considered for execution. that is, if waiting to consume but channel has no data.

smnplk17:06:10

@alexmiller: yeah, thanks for clearing that up.

leo.ribeiro18:06:13

hey guys, for compojure-api in the swagger specs :- means a required parameter, what symbol means an optional parameter?

leo.ribeiro19:06:04

query-params [ids :- String display :- String] — this is what I mean… the above statement generates a two required parameters and I want to be optional 😛

meowy19:06:10

[ids :- (s/optional String)], maybe?

meowy19:06:39

"s" being an alias for schema.core.

meowy19:06:14

Not sure if it works, but give that a shot. x :- y means "`x` must satisfy schema y" in Schema, so I presume you can pass in anything that's a schema in Schema's view.

meowy19:06:31

Refer to Schema's docs for more info: https://github.com/plumatic/schema

leo.ribeiro20:06:29

I found this solution: :query-params [number :- String {id :- String ""}]

leo.ribeiro20:06:48

which means number is required and id is optional, defaul value emptyy

leo.ribeiro20:06:08

I did not try your statement

leo.ribeiro20:06:21

s/optional requires two parameters… 😛

leo.ribeiro20:06:50

I know that for schema optionalkey requires only one key (s/defschema Result {:success Boolean, (s/optional-key :error) String})

meowy20:06:32

Oh yeah, guess that doesn't work. Oh well.