delight-promise

A simple promise implementation for Java.

License

License

GPL
GroupId

GroupId

org.javadelight
ArtifactId

ArtifactId

delight-promise
Last Version

Last Version

0.0.3
Release Date

Release Date

Type

Type

bundle
Description

Description

delight-promise
A simple promise implementation for Java.
Project URL

Project URL

https://github.com/javadelight/delight-promise
Source Code Management

Source Code Management

https://github.com/javadelight/delight-promise

Download delight-promise

Dependencies

compile (4)

Group / Artifact Type Version
org.javadelight : delight-async jar 0.1.5
org.javadelight : delight-factories jar 0.0.3
org.javadelight : delight-simple-log jar 0.0.2
org.eclipse.xtend : org.eclipse.xtend.lib.gwt jar 2.13.0

provided (1)

Group / Artifact Type Version
com.google.gwt : gwt-user jar 2.8.2

test (1)

Group / Artifact Type Version
com.github.oehme.xtend : xtend-junit jar 0.0.1

Project Modules

There are no modules declared in this project.

Build Status

delight-promise

A basic promise implementation for Java.

Usage

Creating a promise:

Promise<Success> p1 = Promises.create(new Operation<Success>() {
	
	@Override
    public void apply(final ValueCallback<String> callback) {
    
    	// do work ...
    	
    	callback.onSuccess(Success.INSTANCE);
    }
});

Resolve promise:

Success succ = p1.get();
// will throw a RuntimeException if promise cannot be resolved.

Resolving multiple promises in parallel:

List<Success> res = Promises.parallel(p1, p2,  ...);

Maven Dependency

<dependency>
    <groupId>org.javadelight</groupId>
    <artifactId>delight-promise</artifactId>
    <version>[insert latest version]</version>
</dependency>

This artifact is available on Maven Central and BinTray.

Maven Central

Links

Part of Java Delight.

All Reports

Versions

Version
0.0.3