Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chain.when(boolean, Action) variant for conditionally adding handlers at chain build time #978

Closed
ldaley opened this issue May 9, 2016 · 0 comments
Milestone

Comments

@ldaley
Copy link
Member

ldaley commented May 9, 2016

We currently have this method: https://ratpack.io/manual/current/api/ratpack/handling/Chain.html#when-ratpack.func.Predicate-ratpack.func.Action-

It allows you to conditionally route based on request time decisions. This ticket would add the following to chain:

default Chain when(boolean test, Action<? super Chain> action) throws Exception {
    if (test) {
      action.execute(this);
    }
    return this;
}

This would effectively be sugar for conditionally adding to the chain at “build time”.

@ldaley ldaley added this to the release-1.4.0 milestone May 9, 2016
@ldaley ldaley closed this as completed in 08c2107 May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant