Class TrackEventDispatcher
Sends events to Amplitude and Userflow on a background thread
Implements
Inherited Members
Namespace: SuperOffice.Util
Assembly: SoDataBase.dll
Syntax
public class TrackEventDispatcher : ITrackEventDispatcher
Constructors
TrackEventDispatcher(IAsyncQueue<TrackEvent>, ILogger<TrackEventDispatcher>)
Sends events to Amplitude and Userflow on a background thread
Declaration
public TrackEventDispatcher(IAsyncQueue<TrackEvent> queue, ILogger<TrackEventDispatcher> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncQueue<TrackEvent> | queue | |
| ILogger<TrackEventDispatcher> | logger |
Methods
GetInstance()
Returns a tracker instance if the feature is enabled, and we are online
Declaration
public static ITrackEventDispatcher GetInstance()
Returns
| Type | Description |
|---|---|
| ITrackEventDispatcher | NULL if not online |
TrackEvent(string, params (string argName, object argVal)[])
Posts event to background job that sends events to Amplitude and/or Userflow
Declaration
public void TrackEvent(string trackEvent, params (string argName, object argVal)[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string | trackEvent | "sale-completed" or "sale-sold" etc |
| (string parameter, object argument)[] | args |
WaitForTrackersToCompleteAsync(CancellationToken)
Sends events to Amplitude and Userflow on a background thread
Declaration
public Task WaitForTrackersToCompleteAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |