Skip to content

Instantly share code, notes, and snippets.

var nextLink;
function open_page(url) {
console.log("Opening " + url);
osmosis.get(url)
.find('#nav td:last a')
.set({
'nextLink': '@href'
})
.find('.g')
.set({
@kunalgrover05
kunalgrover05 / Retry.java
Created February 17, 2017 18:08
Example function for doing retries with Java8 CompletableFuture API
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.function.Supplier;
/**
* A class which implements a Retry API for a Supplier function asynchronously on a new executor
* A retry is triggered when any of the exceptions which are specified is thrown, and retryCount is lower