<commit_before># Vert.x handlers

Handlers provides a minimal and adaptable interface for developing applications on the vert-x3 platform.

[![Build Status](https://travis-ci.org/spriet2000/vertx-handlers.svg?branch=master)](https://travis-ci.org/spriet2000/vertx-handlers)

## Example

```java
    
    Handlers handlers1 = new Handlers(
            (fail, next) -> (e1 -> {
                builder.append("1");
                next.handle(null);
            }),
            (fail, next) -> (e1 -> {
                builder.append("2");
                next.handle(null);
            }))
            .exceptionHandler((Handler) e1 -> hitException.set(true))
            .completeHandler((Handler) e1 -> {
                hitComplete.set(true);
                assertEquals("1234", builder.toString());
            });
            
    Handlers Handlers = new Handlers(
            (fail, next) -> (e1 -> {
                builder.append("3");
                next.handle(null);
            }),
            (fail, next) -> (e1 -> {
                builder.append("4");
                next.handle(null);
            }));
            
    Handlers handlers3 = Handlers.newMerged(handlers1, Handlers);
    
    handlers3.handle(null);
    
    assertEquals(false, hitException.get());
    assertEquals(true, hitComplete.get());

```
## Installation<commit_msg>readmore<commit_after># Vert.x handlers

Handlers provides a minimal and adaptable interface for developing applications on the vert-x3 platform.

[![Build Status](https://travis-ci.org/spriet2000/vertx-handlers.svg?branch=master)](https://travis-ci.org/spriet2000/vertx-handlers)

## Example

```java
    
    AtomicBoolean hitException = new AtomicBoolean(false);
    AtomicBoolean hitComplete = new AtomicBoolean(false);

    StringBuilder builder = new StringBuilder();

    Handlers<StringBuilder> handlers = new Handlers<>(
            f -> hitException.set(true),
            n -> hitComplete.set(true),
            (f, n) -> e -> {
                e.append("1");
                n.handle(e);
            }, (f, n) -> e -> {
                e.append("2");
                n.handle(e);
            }, (f, n) -> e -> {
                e.append("3");
                n.handle(e);
            });
    handlers.handle(builder);

    assertEquals("123", builder.toString());
    assertEquals(false, hitException.get());
    assertEquals(true, hitComplete.get());

```
## Installation
{'fraction_non_alphanumeric': 0.1466011466011466, 'fraction_numerical': 0.0171990171990172, 'mean_word_length': 1.925748502994012, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1283684', 'n_tokens_mistral': 720, 'n_tokens_neox': 677, 'n_words': 130}