X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e0188e2a2598ce57a4d21a3d7eb5f303aecaf0dd..64d8be3badd63b57778ee6ed430a98668512466d:/src/bindings/java/org/simgrid/msg/Task.java?ds=sidebyside diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index 1b2e0cdac1..8900da32e4 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -308,6 +308,55 @@ public class Task { * @param host */ public native static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException; + + /** + * Starts listening for receiving a task from an asynchronous communication with a capped rate + * @param mailbox + */ + public static native Comm irecvBounded(String mailbox, double rate); + /** + * Retrieves next task from the mailbox identified by the specified name with a capped rate + * + * @param mailbox + */ + + public static Task receiveBounded(String mailbox, double rate) throws TransferFailureException, HostFailureException, TimeoutException { + return receiveBounded(mailbox, -1.0, null, rate); + } + + /** + * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds) with a capped rate + * + * @param mailbox + * @param timeout + */ + public static Task receiveBounded(String mailbox, double timeout, double rate) throws TransferFailureException, HostFailureException, TimeoutException { + return receiveBounded(mailbox, timeout, null, rate); + } + + /** + * Retrieves next task sent by a given host on the mailbox identified by the specified alias with a capped rate + * + * @param mailbox + * @param host + */ + + public static Task receiveBounded(String mailbox, Host host, double rate) throws TransferFailureException, HostFailureException, TimeoutException { + return receiveBounded(mailbox, -1.0, host, rate); + } + + /** + * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds) + * with a capped rate + * + * @param mailbox + * @param timeout + * @param host + */ + public native static Task receiveBounded(String mailbox, double timeout, Host host, double rate) throws TransferFailureException, HostFailureException, TimeoutException; + + + /** * Tests whether there is a pending communication on the mailbox identified by the specified alias, and who sent it */