public class AsyncFetcher extends Object implements Fetcher
Modifier and Type | Class and Description |
---|---|
static class |
AsyncFetcher.Builder
A builder for async fetcher class.
|
Modifier and Type | Method and Description |
---|---|
static AsyncFetcher |
buildDefault()
Create an instance of async fetcher with default options.
|
static AsyncFetcher.Builder |
builder()
Create an instance of builder.
|
void |
close() |
Future<Response> |
fetch(Request request)
Fetch the desired HTTP page given in
Request . |
Future<Response> |
fetch(Request request,
Callback callback)
Fetch the desired HTTP page given in
Request . |
void |
start()
Fetcher starter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
interruptAndClose
public static AsyncFetcher buildDefault()
public static AsyncFetcher.Builder builder()
public Future<Response> fetch(Request request)
Fetcher
Request
.public Future<Response> fetch(Request request, Callback callback)
Fetcher
Request
. Executes
callback upon completion.public void start()
Fetcher
public void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 2018. All rights reserved.