Class HttpClientConnector
java.lang.Object
org.nustaq.kontraktor.remoting.http.HttpClientConnector
- All Implemented Interfaces:
org.nustaq.kontraktor.remoting.base.ActorClientConnector
public class HttpClientConnector
extends Object
implements org.nustaq.kontraktor.remoting.base.ActorClientConnector
Created by ruedi on 13/05/15.
Long Poll, http 1.1 based connectivity with on top sequencing + reordering. Designed to handle network outages
and crappy connectivity.
This implies once it successfully connected, it won't go to "closed" except a session timeout/close happened (=>404) (even if server has been stopped after connection)
TODO: proxy options
TODO: provide 1.7 compliant Android client impl
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.apache.http.impl.nio.client.CloseableHttpAsyncClientObject[]static booleanstatic intstatic intFields inherited from interface org.nustaq.kontraktor.remoting.base.ActorClientConnector
OBJECT_MAX_BATCH_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.nustaq.kontraktor.IPromiseorg.nustaq.kontraktor.IPromiseconnect(Function<org.nustaq.kontraktor.remoting.base.ObjectSocket, org.nustaq.kontraktor.remoting.base.ObjectSink> factory) static org.apache.http.impl.nio.client.CloseableHttpAsyncClientprotected voidstartLongPoll(org.nustaq.kontraktor.remoting.http.HttpClientConnector.MyHttpWS myHttpWS)
-
Field Details
-
MAX_CONN_TOTAL
public static int MAX_CONN_TOTAL -
MAX_CONN_PER_ROUTE
public static int MAX_CONN_PER_ROUTE -
DumpProtocol
public static boolean DumpProtocol -
asyncHttpClient
protected static org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncHttpClient -
authData
-
-
Constructor Details
-
HttpClientConnector
-
-
Method Details
-
getClient
public static org.apache.http.impl.nio.client.CloseableHttpAsyncClient getClient() -
connect
public org.nustaq.kontraktor.IPromise connect(Function<org.nustaq.kontraktor.remoting.base.ObjectSocket, org.nustaq.kontraktor.remoting.base.ObjectSink> factory) throws Exception- Specified by:
connectin interfaceorg.nustaq.kontraktor.remoting.base.ActorClientConnector- Throws:
Exception
-
startLongPoll
protected void startLongPoll(org.nustaq.kontraktor.remoting.http.HttpClientConnector.MyHttpWS myHttpWS) -
closeClient
public org.nustaq.kontraktor.IPromise closeClient()- Specified by:
closeClientin interfaceorg.nustaq.kontraktor.remoting.base.ActorClientConnector
-
getReceiveActor
-
getRefPollActor
-