All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jukusoft.vertx.connection.clientserver.Client Maven / Gradle / Ivy

package com.jukusoft.vertx.connection.clientserver;

import com.carrotsearch.hppc.ObjectObjectMap;
import com.jukusoft.vertx.serializer.SerializableObject;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;

import java.util.List;

public interface Client {

    public void init ();

    public void init (Vertx vertx);

    /**
    * connect to server
    */
    public void connect (ServerData server, Handler> handler);

    /**
    * connect to one of these servers
    */
    public void connect (List serverList, Handler> handler);

    public void disconnect ();

    /**
    * set delay for simulating network lag (if server runs on same host)
     *
     * @param sendDelay delay in milliseconds for sending messages
     * @param receiveDelay delay in milliseconds for receiving messages
    */
    public void setDelay (int sendDelay, int receiveDelay);

    public HandlerManager handlers ();

    public void send (SerializableObject msg);

    public void sendRaw (Buffer msg);

    public ObjectObjectMap attributes ();

    public  V getAttribute (String key, Class cls);

    public void putAttribute (String key, Object value);

    public void setThreadPoolSize (int eventThreads, int workerThreads);

    public void shutdown ();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy