Fork me on GitHub
#pedestal
<
2019-03-28
>
souenzzo01:03:40

https://github.com/pedestal/pedestal-ions-sample/blob/master/src/ion_sample/ion.clj#L29 When I call some methods like this in my app, it returns nil. What it means?

souenzzo17:03:19

There is a bug with async interceptors in pedestal.ions. I will try to isolate

souenzzo17:03:42

(let [routes #{["/sync" :get {:name  ::sync
                              :enter (fn [ctx]
                                       (assoc ctx :response {:body   "sync"
                                                             :status 201}))}]
               ["/async" :get {:name  ::async
                               :enter (fn [ctx]
                                        (async/go
                                          (assoc ctx :response {:body   "async"
                                                                :status 202})))}]}
      h (-> {::http/routes         routes
             ::http/chain-provider provider/ion-provider}
            http/default-interceptors
            http/create-provider)]
  (h {:uri            "/sync"
      ;:uri            "/async"
      :request-method :get}))

ddeaguiar19:03:39

@souenzzo going async is not supported at this time. Refer to https://github.com/pedestal/pedestal.ions#caveats

souenzzo20:03:09

it can throw a error? it was quite difficult to debug

ddeaguiar21:03:41

Hmm, yes. I’ll look into that

👍 4