This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-19
Channels
- # aatree (33)
- # admin-announcements (70)
- # alda (6)
- # aleph (2)
- # announcements (6)
- # aws (7)
- # beginners (40)
- # bitcoin (1)
- # boot (138)
- # cider (24)
- # cljs-dev (9)
- # cljsjs (18)
- # cljsrn (35)
- # clojars (4)
- # clojure (211)
- # clojure-art (4)
- # clojure-austria (2)
- # clojure-hamburg (8)
- # clojure-russia (66)
- # clojure-sg (3)
- # clojured (1)
- # clojurescript (73)
- # cursive (9)
- # datomic (124)
- # dirac (8)
- # editors (3)
- # emacs (13)
- # euroclojure (10)
- # hoplon (207)
- # jobs (4)
- # ldnclj (27)
- # lein-figwheel (3)
- # leiningen (10)
- # mount (5)
- # music (1)
- # off-topic (9)
- # om (92)
- # onyx (36)
- # perun (30)
- # proton (47)
- # re-frame (11)
- # reagent (11)
- # ring-swagger (7)
- # yada (2)
I'm trying to use compojure.api with aleph. That works beautifully for the most part, but now I have a route where I want to return a manifold stream to aleph so I can stream results with server-sent events. Somewhere along the way, something tries to JSON encode the manifold stream:
com.fasterxml.jackson.core.JsonGenerationException: Cannot JSON encode object of class: class manifold.stream.async.CoreAsyncSource: manifold.stream.async.CoreAsyncSource@5b0805c7
at cheshire.generate$generate.invoke(generate.clj:148)
at cheshire.core$generate_string.invoke(core.clj:31)
at ring.middleware.format_response$make_json_encoder$fn__18470.invoke(format_response.clj:210)
at ring.middleware.format_response$wrap_format_response$fn__18460.invoke(format_response.clj:193)
at ring.middleware.keyword_params$wrap_keyword_params$fn__18594.invoke(keyword_params.clj:35)
at ring.middleware.nested_params$wrap_nested_params$fn__18644.invoke(nested_params.clj:84)
at ring.middleware.params$wrap_params$fn__18728.invoke(params.clj:64)
at compojure.api.middleware$wrap_options$fn__22290.invoke(middleware.clj:93)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at aleph.http.server$wrap_stream__GT_input_stream$fn__13574.invoke(server.clj:403)
at aleph.http.server$handle_request$fn__13492$f__2183__auto____13493.invoke(server.clj:153)
at clojure.lang.AFn.run(AFn.java:22)
at io.aleph.dirigiste.Executor$Worker$1.run(Executor.java:49)
at java.lang.Thread.run(Thread.java:745)
How can I tell it not to?Should be controlled by https://github.com/metosin/compojure-api/blob/master/src/compojure/api/middleware.clj#L130-L137
Not sure if CoreAsyncSource implements collection, that would case the second condition to be true
Have you defined return schema for the route? That always forces response encoding