Skip to content

Latest commit

 

History

History

riptide-capture

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Riptide: Capture

Glass of Water

Javadoc Maven Central

Riptide: Capture adds the possibility to produce meaningful return values with Riptide.

Example

Capture<Order> capture = Capture.empty();

Order order = http.get("/sales-orders/{id}", id)
    .dispatch(series(),
        on(SUCCESSFUL).dispatch(contentType(),
            on(MediaTypes.ORDER).call(Order.class, capture)))
    .thenApply(capture).join();

Features

  • produce return values based on Riptide's asynchronous API
  • type-safe

Dependencies

  • Riptide: Core

Installation

Add the following dependency to your project:

<dependency>
    <groupId>org.zalando</groupId>
    <artifactId>riptide-capture</artifactId>
    <version>${riptide.version}</version>
</dependency>

Usage

Asynchronous return values

public CompletableFuture<Order> getOrder(final String id) {
    Capture<Order> capture = Capture.empty();
    
    return http.get("/sales-orders/{id}", id)
        .dispatch(series(),
            on(SUCCESSFUL).dispatch(contentType(),
                on(MediaTypes.ORDER).call(Order.class, capture)))
        .thenApply(capture);
}

Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.

Getting Involved/Contributing

To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For more details, check the contribution guidelines.