Package sample
Class BlockingFlush
- java.lang.Object
-
- sample.BlockingFlush
-
public class BlockingFlush extends java.lang.ObjectTheAnalyticsclass doesn't come with a blockingAnalytics.flush()implementation out of the box. It's trivial to build one using aPhaserthat monitors requests and is able to block until they're uploaded.BlockingFlush blockingFlush = BlockingFlush.create(); Analytics analytics = Analytics.builder(writeKey) .plugin(blockingFlush.plugin()) .build(); // Do some work. analytics.flush(); // Trigger a flush. blockingFlush.block(); // Block until the flush completes. analytics.shutdown(); // Shut down after the flush is complete.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblock()static BlockingFlushcreate()com.segment.analytics.Pluginplugin()
-
-
-
Method Detail
-
create
public static BlockingFlush create()
-
plugin
public com.segment.analytics.Plugin plugin()
-
block
public void block()
-
-