Fork me on GitHub

could someone explain the :bindings in the context map? what is the use case for them?


> As accepted by clojure.core/with-bindings. Prior to delegating execution to any interceptor, the interceptor framework will ensure that the bindings specified in this map are installed using clojure.core/with-bindings. If this map is altered and included in the returned context from an interceptor, the new bindings in the map will be installed as thread local bindings prior to another interceptor’s execution.


if you do (bindings [db (get-db)] (run-query)) then you can create a chain like [interceptor-get-db handler-run-query]


thanks. Is there a case where that is better/recommended over to just assoccing in the db-con into context and thus making the binding explicit? Thread locals are really slow both to read & write.