org.zbus.net.Invoker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zbus Show documentation
Show all versions of zbus Show documentation
lightweight message queue, service bus
package org.zbus.net;
import java.io.IOException;
import org.zbus.net.Sync.ResultCallback;
/**
* The abstraction of remote invocation:
* 1) invoke synchronously
* 2) invoke asynchronously with a callback
*
* @author rushmore (洪磊明)
*
* @param request type
* @param response type
*/
public interface Invoker {
/**
* invoke synchronously with a timeout specified
*
* @param req request message/object
* @param timeout waiting timeout in milliseconds
* @return response message/object
* @throws IOException if network failure happens
* @throws InterruptedException if invocation is interrupted
*/
RES invokeSync(REQ req, int timeout) throws IOException, InterruptedException;
/**
* invoke asynchronously
* @param req request message/object
* @param callback called when the response arrive
* @throws IOException if network failure happens
*/
void invokeAsync(REQ req, ResultCallback callback) throws IOException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy