This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-14
Channels
- # aleph (14)
- # bangalore-clj (2)
- # beginners (39)
- # boot (18)
- # carry (7)
- # cider (37)
- # cljs-dev (1)
- # cljsrn (4)
- # clojure (74)
- # clojure-austin (12)
- # clojure-canada (6)
- # clojure-conj (15)
- # clojure-dev (3)
- # clojure-greece (14)
- # clojure-italy (1)
- # clojure-korea (1)
- # clojure-poland (3)
- # clojure-russia (5)
- # clojure-spec (22)
- # clojure-uk (13)
- # clojurebridge (9)
- # clojurescript (231)
- # cursive (2)
- # datascript (9)
- # datomic (12)
- # devcards (2)
- # emacs (2)
- # events (4)
- # hoplon (28)
- # off-topic (35)
- # om (61)
- # onyx (8)
- # parinfer (8)
- # proton (1)
- # re-frame (53)
- # reagent (10)
- # ring-swagger (8)
- # specter (11)
- # untangled (3)
- # vim (4)
Has anybody done event sourcing with Clojure? Ive been looking at Apache Kafka and it seems really interesting, but I am wondering if there is some pure Clojure alternative or a more idiomatic way to handle this problem
@adamkowalski that's a question that you could certainly ask in the #clojure channel. Not really a beginner level question imo 🙂 But I think @viesti may have do ES with clojure
Hmm. Ok, noob on promises here. I have the following code and I can't seem to find a way to deref a specific promise inside the response.
(let [client (http.async.client/create-client)
resp (http.async.client/POST
client
""
:body {:username "Dithcord" :content "Still Testing"}
:headers {:content-type "application/x-www-form-urlencoded"}
)
]
(prn (@:status @resp))
)
I've tried different variations of (:status @resp)
and (@status resp)
and others but I really can't get it to work.I'm sure it's.... probably basic
ooooooh there we go. (prn @(response :status))
well then.
@adamkowalski So I’ve been using Kafka (0.8.2) in an analytics project, piping user activity events from currently two main sources. Small http server that produces messages to Kafka and another set of apps that read and transform messages before ingesting to Redshift through S3. Both in Clojure, using clj-kafka (https://github.com/pingles/clj-kafka).
don’t know the actual use case here, but Kafka has a lively ecosystem, we’r now looking into PipelineDB https://www.pipelinedb.com/ to satisfy our “domain experts” which are fluent in sql but not so fluent in Clojure, yet 🙂
depends on what you need, there might be simpler alternatives (like if just a persistent queue, then https://github.com/Factual/durable-queue)
but true, this is more an advanced question than beginner level, although some entry into this set of tools would be neat :)
nowadays Kafka tries to orient to microservices more than just analytics (AWS Kinesis competes in this area, using "as a service product" is compelling), which makes using Kafka for ES compelling imho, although there is a learning/installation curve
broader topic this thing, involves data transfer whole company wise, if one does full buy-in into ES :)
Why does this look like pure spamming?
:thinking_face:
And no clear question
It actually does look like semi-random text spam with some links though, tbh.
However I just realized you were called here for a previous question lol
so nevermind me
It's just 3am and I'm trying to figure out this vague non-helpful error with no stack
too fast response while jumping off the bus and walking to work “look more into these” spam of links 🙂
Alright. Question. I'm using http.client.async
and I'm doing a post
.... and I get a 411 Length Required
response. How do I fix this? None of the code in the test suite seems to specify it 😞
@eslachance Perhaps set the content-length header?
@mikeb I tried that, I'm apparently not using headers
properly because only the first one (Authorization) is being sent, the rest aren't part of the request if I am to believe the contents of resp
:
(let [client (http/create-client :follow-redirects true)
resp (http/POST
client
(str " " channel "/messages")
:body {:content msg}
:headers {"Authorization" (str "Bot " (get @session :token))
"Content-type" "application/x-www-form-urlencoded"
"Content-length" 13})]
resp)
Ah I see what's happening. You're using an http:// address and http://discordapp.com is re-directing you to the https address.
So try using (str "https://discordapp.com/api/v6/channels/" channel "/messages")
Hmm. Oh! huh. let me see
What clued me in was your :follow-redirects setting. If an http post is redirected, the posted body isn't transmitted the new address. The way you can find these sorts of things is to use the chrome dev tools network tab to see the back and forth between the browser and server.
oh my god... wow
It actually works. I can't believe I just had a successful ping/pong. @mikeb you're my saviour for today 😄
I really wish slack had a dark theme.
@viesti: for what it's worth, i appreciated the info about event sourcing solutions, didnt see factual's queue before :)
I have a function called encode that converts each character of a string into a binary code. How could I output the result of each encoding one by one, simulating a delay between conversion of each character? I am thinking I put the output on a queue of some kind and then the function to display pulls them off one at a time with some kind of delay between pulling each converted character from the queue. This queue does not need to be performant in any way, I'm simply trying to visualise the encoding & decoding process to a human can see it.