A Snowplow interface was added in #340. This class contains static methods for creating and managing Trackers, without needing to create other objects first. The internal classes of the tracker - BatchEmitter or Subject - can be created behind-the-scenes, or via Configuration objects.
The BatchEmitter is the default Emitter; it uses a thread pool to asynchronously process and send events. The threads are non-daemon threads. To safely shut down the tracker, the BatchEmitter contains a close() method, which attempts to send all remaining buffered events and then terminates the thread pool executor.
The close() method is not part of the Emitter interface. This makes it clumsy and non-intuitive to stop a tracker:
A
Snowplow
interface was added in #340. This class contains static methods for creating and managing Trackers, without needing to create other objects first. The internal classes of the tracker - BatchEmitter or Subject - can be created behind-the-scenes, or via Configuration objects.The
BatchEmitter
is the defaultEmitter
; it uses a thread pool to asynchronously process and send events. The threads are non-daemon threads. To safely shut down the tracker, theBatchEmitter
contains aclose()
method, which attempts to send all remaining buffered events and then terminates the thread pool executor.The
close()
method is not part of theEmitter
interface. This makes it clumsy and non-intuitive to stop a tracker:Ideally it would be:
Or even better:
This can be achieved by updating the
Emitter
interface and also addingclose()
to the Tracker class.