Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
pron committed May 17, 2015
1 parent 8a748de commit c6884a0
Showing 1 changed file with 3 additions and 6 deletions.
Expand Up @@ -151,12 +151,11 @@ public final <T> T tryReceive(MessageProcessor<? super Message, T> proc) {
* Messages that are not selected, are temporarily skipped. They will remain in the mailbox until another call to receive (selective or
* non-selective) retrieves them.
*
* @param <T> The type of the returned value
* @param type the type of the messages to select
* @return The next message of the wanted type.
* @throws InterruptedException
*/
public final <T extends Message> T receive(final Class<T> type) throws SuspendExecution, InterruptedException {
public final <M extends Message> M receive(final Class<M> type) throws SuspendExecution, InterruptedException {
return helper.receive(SelectiveReceiveHelper.ofType(type));
}

Expand All @@ -167,15 +166,14 @@ public final <T extends Message> T receive(final Class<T> type) throws SuspendEx
* Messages that are not selected, are temporarily skipped. They will remain in the mailbox until another call to receive (selective or
* non-selective) retrieves them.
*
* @param <T> The type of the returned value
* @param timeout the duration to wait for a matching message to arrive.
* @param unit timeout's time unit.
* @param type the type of the messages to select
* @return The next message of the wanted type, or {@code null} if the timeout expires.
* @throws SuspendExecution
* @throws InterruptedException
*/
public final <T extends Message> T receive(long timeout, TimeUnit unit, final Class<T> type) throws SuspendExecution, InterruptedException, TimeoutException {
public final <M extends Message> M receive(long timeout, TimeUnit unit, final Class<M> type) throws SuspendExecution, InterruptedException, TimeoutException {
return helper.receive(timeout, unit, SelectiveReceiveHelper.ofType(type));
}

Expand All @@ -186,14 +184,13 @@ public final <T extends Message> T receive(long timeout, TimeUnit unit, final Cl
* Messages that are not selected, are temporarily skipped. They will remain in the mailbox until another call to receive (selective or
* non-selective) retrieves them.
*
* @param <T> The type of the returned value
* @param timeout the method will not block for longer than the amount remaining in the {@link Timeout}
* @param type the type of the messages to select
* @return The next message of the wanted type, or {@code null} if the timeout expires.
* @throws SuspendExecution
* @throws InterruptedException
*/
public final <T extends Message> T receive(Timeout timeout, final Class<T> type) throws SuspendExecution, InterruptedException, TimeoutException {
public final <M extends Message> M receive(Timeout timeout, final Class<M> type) throws SuspendExecution, InterruptedException, TimeoutException {
return helper.receive(timeout, SelectiveReceiveHelper.ofType(type));
}

Expand Down

0 comments on commit c6884a0

Please sign in to comment.