/** * Launch an isolated MediaDriver embedded in the current process with a generated aeronDirectoryName that can be * retrieved by calling aeronDirectoryName. * <p> * If the aeronDirectoryName is set as a system property to something different than * {@link CommonContext#AERON_DIR_PROP_DEFAULT} then this set value will be used. * * @return the newly started MediaDriver. */ public static MediaDriver launchEmbedded() { return launchEmbedded(new Context()); }
final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null;
final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null; final ExecutorService executor = Executors.newFixedThreadPool(1); final Aeron.Context ctx = new Aeron.Context()
public static void main(final String[] args) throws Exception final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null; final Aeron.Context ctx = new Aeron.Context().availableImageHandler(Ping::availablePongImageHandler); final FragmentHandler fragmentHandler = new FragmentAssembler(Ping::pongHandler);
final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null; final Aeron.Context ctx = new Aeron.Context() .availableImageHandler(SamplesUtil::printAvailableImage)
public static void main(final String[] args) final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null;
final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null; final Aeron.Context context = new Aeron.Context();
.errorHandler(Throwable::printStackTrace); try (MediaDriver ignore = MediaDriver.launchEmbedded(driverCtx))
@Test public void shouldStartAndStopInstantly() { final MediaDriver.Context driverCtx = new MediaDriver.Context() .errorHandler(Throwable::printStackTrace); try (MediaDriver ignore = MediaDriver.launchEmbedded(driverCtx)) { final Aeron.Context clientCtx = new Aeron.Context() .aeronDirectoryName(driverCtx.aeronDirectoryName()); //noinspection EmptyTryBlock try (Aeron ignored = Aeron.connect(clientCtx)) { // ignore } } finally { driverCtx.deleteAeronDirectory(); } } }
private void launch(final String channelOne, final int streamOne, final String channelTwo, final int streamTwo) { driverOne = MediaDriver.launchEmbedded( new MediaDriver.Context() .errorHandler(Throwable::printStackTrace) .termBufferSparseFile(true)); driverTwo = MediaDriver.launchEmbedded( new MediaDriver.Context() .errorHandler(Throwable::printStackTrace) .termBufferSparseFile(true)); publisherOne = Aeron.connect(new Aeron.Context().aeronDirectoryName(driverOne.aeronDirectoryName())); subscriberOne = Aeron.connect(new Aeron.Context().aeronDirectoryName(driverTwo.aeronDirectoryName())); publisherTwo = Aeron.connect(new Aeron.Context().aeronDirectoryName(driverOne.aeronDirectoryName())); subscriberTwo = Aeron.connect(new Aeron.Context().aeronDirectoryName(driverTwo.aeronDirectoryName())); subscriptionOne = subscriberOne.addSubscription(channelOne, streamOne); subscriptionTwo = subscriberTwo.addSubscription(channelTwo, streamTwo); publicationOne = publisherOne.addPublication(channelOne, streamOne); publicationTwo = publisherTwo.addPublication(channelTwo, streamTwo); }
/** * Launch an isolated MediaDriver embedded in the current process with a generated aeronDirectoryName that can be * retrieved by calling aeronDirectoryName. * <p> * If the aeronDirectoryName is set as a system property to something different than * {@link CommonContext#AERON_DIR_PROP_DEFAULT} then this set value will be used. * * @return the newly started MediaDriver. */ public static MediaDriver launchEmbedded() { return launchEmbedded(new Context()); }
/** * Launch an isolated MediaDriver embedded in the current process with a generated aeronDirectoryName that can be * retrieved by calling aeronDirectoryName. * <p> * If the aeronDirectoryName is set as a system property to something different than * {@link CommonContext#AERON_DIR_PROP_DEFAULT} then this set value will be used. * * @return the newly started MediaDriver. */ public static MediaDriver launchEmbedded() { return launchEmbedded(new Context()); }
server = StatusServer.startServer(new InMemoryStatusStorage(), statusPort); if (mediaDriver == null) mediaDriver = MediaDriver.launchEmbedded(); log.info("Started media driver with aeron directory " + mediaDriver.aeronDirectoryName());
server = StatusServer.startServer(new InMemoryStatusStorage(), statusPort); if (mediaDriver == null) mediaDriver = MediaDriver.launchEmbedded(); log.info("Started media driver with aeron directory " + mediaDriver.aeronDirectoryName());
.senderIdleStrategy(new BusySpinIdleStrategy()); mediaDriver = MediaDriver.launchEmbedded(mediaDriverCtx);
.keepAliveInterval(100000000); driver = MediaDriver.launchEmbedded(); context.aeronDirectoryName(driver.aeronDirectoryName()); aeron = Aeron.connect(context);
.keepAliveInterval(100000000); driver = MediaDriver.launchEmbedded(); context.aeronDirectoryName(driver.aeronDirectoryName()); aeron = Aeron.connect(context);
driver = MediaDriver.launchEmbedded();
driver = MediaDriver.launchEmbedded();