C# Class DeltaDNA.EventStore

The Event Store queues game events until they are ready to be sent to Collect. It is a double buffer queue, events are written to one queue whilst being read from another. Mostly files are used to hold the events as UTF8 json strings. For platforms that don't support filesystem, such as Webplayer in memory files are used instead.
Inheritance: IDisposable
Show file Open project: deltaDNA/unity-sdk

Public Methods

Method Description
ClearAll ( ) : void

Clears both in and out buffers.

ClearOut ( ) : void

Clears the out buffer.

ClearStream ( Stream stream ) : void
Dispose ( ) : void
EventStore ( string dir ) : System

Initializes a new instance of the DeltaDNA.EventStore class.

FlushBuffers ( ) : void

Flushs the buffers to disk.

Push ( string obj ) : bool

Add a new event to the in buffer.

PushEvent ( string obj, Stream stream ) : bool
Read ( ) : List

Reads events from the out buffer.

ReadEvents ( Stream stream, IList events ) : void
Swap ( ) : bool

Swap the in and out buffers over.

SwapStreams ( Stream &sin, Stream &sout ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
InitialiseFileStreams ( string dir ) : bool

Method Details

ClearAll() public method

Clears both in and out buffers.
public ClearAll ( ) : void
return void

ClearOut() public method

Clears the out buffer.
public ClearOut ( ) : void
return void

ClearStream() public static method

public static ClearStream ( Stream stream ) : void
stream Stream
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

EventStore() public method

Initializes a new instance of the DeltaDNA.EventStore class.
public EventStore ( string dir ) : System
dir string Full path on the filesystem where to create the files.
return System

FlushBuffers() public method

Flushs the buffers to disk.
public FlushBuffers ( ) : void
return void

Push() public method

Add a new event to the in buffer.
public Push ( string obj ) : bool
obj string
return bool

PushEvent() public static method

public static PushEvent ( string obj, Stream stream ) : bool
obj string
stream Stream
return bool

Read() public method

Reads events from the out buffer.
public Read ( ) : List
return List

ReadEvents() public static method

public static ReadEvents ( Stream stream, IList events ) : void
stream Stream
events IList
return void

Swap() public method

Swap the in and out buffers over.
public Swap ( ) : bool
return bool

SwapStreams() public static method

public static SwapStreams ( Stream &sin, Stream &sout ) : void
sin Stream
sout Stream
return void