pedestal

stacktracer 2019-07-15T20:51:46.059600Z

Noob question ... in the pedestal async example:

(interceptors/defbefore takes-time
      [context]
      (let [channel (chan)]
        (go
         (let [result (lengthy-computation (:request context))
               new-context (assoc context :response (ring-resp/response result))]
           (>! channel new-context)))
        channel))
... is there a reason to create channel explicitly, rather than use the implicit channel that receives the result of the go body? In other words, why do the above instead of this:
(interceptors/defbefore takes-time
      [context]
      (go
        (let [result (lengthy-computation (:request context))]
          (assoc context :response (ring-resp/response result)))))

2019-07-15T21:08:36.061500Z

@stacktracer I can’t think of a reason in this case. There are no options being passed during channel creation in this example.

stacktracer 2019-07-15T23:50:59.062500Z

@ddeaguiar Thanks for the sanity check!