This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-15
Channels
- # aws-lambda (3)
- # beginners (37)
- # boot (294)
- # carry (1)
- # cider (38)
- # cljs-dev (37)
- # cljsjs (88)
- # clojure (187)
- # clojure-android (2)
- # clojure-austin (1)
- # clojure-dusseldorf (9)
- # clojure-hk (3)
- # clojure-italy (12)
- # clojure-russia (36)
- # clojure-spec (55)
- # clojure-uk (27)
- # clojurescript (75)
- # community-development (5)
- # conf-proposals (2)
- # copenhagen-clojurians (3)
- # cursive (9)
- # datomic (54)
- # devcards (5)
- # devops (3)
- # dirac (69)
- # emacs (6)
- # ethereum (1)
- # euroclojure (1)
- # events (3)
- # funcool (1)
- # hoplon (20)
- # immutant (4)
- # luminus (14)
- # midje (4)
- # om (178)
- # om-next (2)
- # onyx (47)
- # pedestal (19)
- # protorepl (20)
- # re-frame (14)
- # reagent (54)
- # ring (2)
- # ring-swagger (7)
- # test-check (10)
- # uncomplicate (11)
- # untangled (9)
- # yada (9)
Evening everyone! I have a question about the swagger integration. I don’t see anything about what messages are returned to the consumer of the API. For example, if I return the json below I would want to display in swagger that you’d receive a; array of maps with count and modified_date keys.
[
{
"count": 556,
"modified_date": "2016-09-12"
},
{
"count": 1,
"modified_date": "2016-09-14"
}
]
Looking at the ring-swagger stuff it looks like you can include a :schema
key with a Plumatic Schema to the :responses
key for a particular status code.
I was trying to get SO_REUSEPORT
to work. The aim is to have zero-downtime deployment. As far as I understand, using SO_REUSEPORT
, one can have two (or more) applications listening to the same port (without having a Address already in use
-issue). So:
(ns ...
(:require ...
[aleph.http :as http]
...))
...
(let [http-server (http/start-server
(bidi/make-handler api)
(conj (::http config)
{:bootstrap-transform
#(doto %
(.option ChannelOption/SO_BROADCAST true)
(.option EpollChannelOption/SO_REUSEPORT true))}))]
(netty/wait-for-close http-server)))
Just very quick questions: did anyone try to get SO_REUSEPORT to work (with yada/aleph/netty in clojure)? Did it work? How did you do it 🙂?
(http://marrachem.blogspot.be/2014/09/multi-threaded-udp-server-with-netty-on.html , https://sam.andrews-home.com/post/netty-doesnt-suck-at-udp-servers)@kurt-yagram: my memory of reuseport (from C sockets) was this: If I started a server too quickly after killing the old one, the kernel wouldn't have released it. But I don't remember it allowing parallel listeners. Who's response wins?
Well, I thought it would be like a kind of load balancing, but apparently, it doesn't work like that. I mean, it doesn't seem to be possible to make 2 applications listening on the same port (and the os taking care of dispatch/choosing one).
I'm implementing sse with yada. All seems to work fine, except, yada prepends data:
to all messages. This would be fine, if sse message only have a data:
-field, which is not the case. They also accept retry
, id
and event
-fields. Can this be configured somewhere? I'd like to send messages like:
id: <message-id>\n
data: whatever\n\n
Hi @kurt-yagram - trying providing your own defmethod for text/event-stream, taking the existing code as a template.
That way you'll have full control. The current implementation works as a HOWTO. Yada is declarative to a point, but beyond it's programming that takes over.
allright 🙂