/** * Sends a message to all members and expects responses from members in dests (if non-null). * @param dests A list of group members from which to expect responses (if the call is blocking). * @param data The message to be sent * @param opts A set of options that govern the call. See {@link org.jgroups.blocks.RequestOptions} for details * @return CompletableFuture<T> A future from which the results (RspList) can be retrieved, or null if the request * was sent asynchronously * @throws Exception If the request cannot be sent */ public <T> CompletableFuture<RspList<T>> castMessageWithFuture(final Collection<Address> dests, Buffer data, RequestOptions opts) throws Exception { return cast(dests,data,opts,false); }
/** * Sends a message to all members and expects responses from members in dests (if non-null). * @param dests A list of group members from which to expect responses (if the call is blocking). * @param data The message to be sent * @param opts A set of options that govern the call. See {@link org.jgroups.blocks.RequestOptions} for details * @return RspList A list of Rsp elements, or null if the RPC is asynchronous * @throws Exception If the request cannot be sent * @since 2.9 */ public <T> RspList<T> castMessage(final Collection<Address> dests, Buffer data, RequestOptions opts) throws Exception { GroupRequest<T> req=cast(dests, data, opts, true); return req != null? req.getNow(null) : null; }
protected <T> GroupRequest<T> cast(final Collection<Address> dests, byte[] data, int offset, int length, RequestOptions options, boolean block_for_results) throws Exception { return cast(dests, new Buffer(data, offset, length), options, block_for_results); }
/** * Sends a message to all members and expects responses from members in dests (if non-null). * @param dests A list of group members from which to expect responses (if the call is blocking). * @param data The message to be sent * @param opts A set of options that govern the call. See {@link org.jgroups.blocks.RequestOptions} for details * @return CompletableFuture<T> A future from which the results (RspList) can be retrieved, or null if the request * was sent asynchronously * @throws Exception If the request cannot be sent */ public <T> CompletableFuture<RspList<T>> castMessageWithFuture(final Collection<Address> dests, Buffer data, RequestOptions opts) throws Exception { return cast(dests,data,opts,false); }
protected <T> GroupRequest<T> cast(final Collection<Address> dests, byte[] data, int offset, int length, RequestOptions options, boolean block_for_results) throws Exception { return cast(dests, new Buffer(data, offset, length), options, block_for_results); }
/** * Sends a message to all members and expects responses from members in dests (if non-null). * @param dests A list of group members from which to expect responses (if the call is blocking). * @param data The message to be sent * @param opts A set of options that govern the call. See {@link org.jgroups.blocks.RequestOptions} for details * @return RspList A list of Rsp elements, or null if the RPC is asynchronous * @throws Exception If the request cannot be sent * @since 2.9 */ public <T> RspList<T> castMessage(final Collection<Address> dests, Buffer data, RequestOptions opts) throws Exception { GroupRequest<T> req=cast(dests, data, opts, true); return req != null? req.getNow(null) : null; }