public class JetlangTcpClient extends Object implements JetlangClient
Constructor and Description |
---|
JetlangTcpClient(SocketConnector socketConnector,
org.jetlang.fibers.Fiber sendFiber,
JetlangClientConfig config,
Serializer ser,
ErrorHandler errorHandler) |
Modifier and Type | Method and Description |
---|---|
LogoutResult |
close(boolean sendLogoutIfStillConnected) |
void |
execOnSendThread(org.jetlang.core.Callback<SocketWriter> cb) |
org.jetlang.channels.Subscriber<CloseEvent> |
getCloseChannel() |
org.jetlang.channels.Subscriber<ConnectEvent> |
getConnectChannel() |
org.jetlang.channels.Subscriber<DeadMessageEvent> |
getDeadMessageChannel() |
org.jetlang.channels.Subscriber<ReadTimeoutEvent> |
getReadTimeoutChannel() |
<T> void |
publish(String topic,
T msg) |
<T> void |
publish(String topic,
T msg,
Runnable onSend) |
<T> org.jetlang.core.Disposable |
request(String reqTopic,
Object req,
org.jetlang.core.DisposingExecutor executor,
org.jetlang.core.Callback<T> callback,
org.jetlang.core.Callback<TimeoutControls> timeoutRunnable,
int timeout,
TimeUnit timeUnit) |
void |
start() |
<T> org.jetlang.core.Disposable |
subscribe(String topic,
org.jetlang.core.DisposingExecutor clientFiber,
org.jetlang.core.Callback<T> cb) |
<T> org.jetlang.core.Disposable |
subscribe(String subject,
org.jetlang.channels.Subscribable<T> callback) |
public JetlangTcpClient(SocketConnector socketConnector, org.jetlang.fibers.Fiber sendFiber, JetlangClientConfig config, Serializer ser, ErrorHandler errorHandler)
public <T> org.jetlang.core.Disposable subscribe(String subject, org.jetlang.channels.Subscribable<T> callback)
subscribe
in interface JetlangClient
public void start()
start
in interface JetlangClient
public <T> org.jetlang.core.Disposable subscribe(String topic, org.jetlang.core.DisposingExecutor clientFiber, org.jetlang.core.Callback<T> cb)
subscribe
in interface JetlangClient
public LogoutResult close(boolean sendLogoutIfStillConnected)
close
in interface JetlangClient
public <T> org.jetlang.core.Disposable request(String reqTopic, Object req, org.jetlang.core.DisposingExecutor executor, org.jetlang.core.Callback<T> callback, org.jetlang.core.Callback<TimeoutControls> timeoutRunnable, int timeout, TimeUnit timeUnit)
request
in interface JetlangClient
public org.jetlang.channels.Subscriber<CloseEvent> getCloseChannel()
getCloseChannel
in interface JetlangClient
public org.jetlang.channels.Subscriber<ReadTimeoutEvent> getReadTimeoutChannel()
getReadTimeoutChannel
in interface JetlangClient
public org.jetlang.channels.Subscriber<ConnectEvent> getConnectChannel()
getConnectChannel
in interface JetlangClient
public org.jetlang.channels.Subscriber<DeadMessageEvent> getDeadMessageChannel()
getDeadMessageChannel
in interface JetlangClient
public <T> void publish(String topic, T msg)
publish
in interface JetlangClient
public void execOnSendThread(org.jetlang.core.Callback<SocketWriter> cb)
execOnSendThread
in interface JetlangClient
Copyright © 2016. All Rights Reserved.