// Path: porcupine-sample/src/main/java/com/airhacks/threading/messages/control/MessageReceiver.java
// public class MessageReceiver {
// 
//     public String receiveLightMessage() {
//         return "Message " + new Date();
//     }
// 
//     public String receiveHeavyMessage() {
//         try {
//             Thread.sleep(5000);
//         } catch (InterruptedException ex) {
//             Logger.getLogger(MessageReceiver.class.getName()).log(Level.SEVERE, null, ex);
//         }
//         return "Message " + new Date();
//     }
// }


import com.airhacks.porcupine.execution.boundary.Dedicated;
import com.airhacks.threading.messages.control.MessageReceiver;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.function.Consumer;
import javax.ejb.Stateless;
import javax.inject.Inject;
package com.airhacks.threading.messages.boundary;


/**
 *
 * @author airhacks.com
 */
@Stateless
public class MessagesService {

    @Inject
    @Dedicated
    ExecutorService light;

    @Inject
    @Dedicated
    ExecutorService heavy;

    @Inject
// Path: porcupine-sample/src/main/java/com/airhacks/threading/messages/control/MessageReceiver.java
// public class MessageReceiver {
// 
//     public String receiveLightMessage() {
//         return "Message " + new Date();
//     }
// 
//     public String receiveHeavyMessage() {
//         try {
//             Thread.sleep(5000);
//         } catch (InterruptedException ex) {
//             Logger.getLogger(MessageReceiver.class.getName()).log(Level.SEVERE, null, ex);
//         }
//         return "Message " + new Date();
//     }
// }


// Path: porcupine-sample/src/main/java/com/airhacks/threading/messages/boundary/MessagesService.java
import com.airhacks.porcupine.execution.boundary.Dedicated;
import com.airhacks.threading.messages.control.MessageReceiver;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.function.Consumer;
import javax.ejb.Stateless;
import javax.inject.Inject;

package com.airhacks.threading.messages.boundary;


/**
 *
 * @author airhacks.com
 */
@Stateless
public class MessagesService {

    @Inject
    @Dedicated
    ExecutorService light;

    @Inject
    @Dedicated
    ExecutorService heavy;

    @Inject
    MessageReceiver fetcher;