Skip to content

fixpoint-clojure/interceptors

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Fixpoint Interceptors

Interceptors for asynchronous web handlers.

Check out the blog post.

Current version

Please use the git sha method of dependencies.

Usage

Require the library.

(require '[fixpoint.interceptors :as int])

Interceptors are vectors of maps. Each map can contain three keys, :enter, :leave, and :error. The values for those keys are functions of one argument. You can compose two or more Interceptors with the chain function, which will return a new Interceptor.

When you've got your Interceptor just how you like it, you can call run on it to run a value through it.

normalize will convert a few different types into Interceptors. chain will normalize its arguments.

Example

(require '[fixpoint.interceptors :as int])

(def i [{:enter inc :leave inc}])

(run i 0) ;=> 2

Testing

$CMD clj -Atest

License

Copyright © 2018 Eric Normand

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Interceptors for asynchronous web handlers in Clojure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published