package lc.mecha.mq;

import lc.mecha.log.MechaLogger;
import lc.mecha.log.MechaLoggerFactory;
import org.junit.jupiter.api.Test;

public class FanoutTest {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(FanoutTest.class);

    @Test
    public void testFanout() throws InterruptedException {
        Fanout<String> f = new Fanout<>();

        Queue<String> q1 = f.createQueue();
        Queue<String> q2 = f.createQueue();

        f.write("Hello World!");

        String s1 = q1.read();
        String s2 = q2.read();

        logger.info("Results: [s1:{}] [s2:{}]", s1, s2);
    }
}
