Class BaseDataConsumer<T>
Base class for data consumers to inherit from.
Inherited Members
Namespace: Unity.SimulationPro
Assembly: Unity.SimulationPro.Capture.dll
Syntax
public abstract class BaseDataConsumer<T>
Type Parameters
| Name | Description |
|---|---|
| T | The message type. |
Constructors
BaseDataConsumer()
Initializes a new BaseDataConsumer<T> and subscribes it to the manager's per-frame tick.
Declaration
protected BaseDataConsumer()
Fields
_keysToRemove
The eys to remove.
Declaration
protected List<string> _keysToRemove
Field Value
| Type | Description |
|---|---|
| List<string> |
_uploadIsArtifact
The upload is artifact.
Declaration
protected Dictionary<string, bool> _uploadIsArtifact
Field Value
| Type | Description |
|---|---|
| Dictionary<string, bool> |
_uploadQueue
The upload queue.
Declaration
protected Queue<string> _uploadQueue
Field Value
| Type | Description |
|---|---|
| Queue<string> |
_uploadsInFlight
The uploads in flight.
Declaration
protected Dictionary<string, BaseDataConsumer<T>.Uploadable> _uploadsInFlight
Field Value
| Type | Description |
|---|---|
| Dictionary<string, BaseDataConsumer<T>.Uploadable> |
kMaxSimultaneousUploads
The max simultaneous uploads.
Declaration
protected const int kMaxSimultaneousUploads = 50
Field Value
| Type | Description |
|---|---|
| int |
kMaxUploadRetryAttempts
The max upload retry attempts.
Declaration
protected const int kMaxUploadRetryAttempts = 5
Field Value
| Type | Description |
|---|---|
| int |
kUseConsoleLog
The use console log.
Declaration
protected const bool kUseConsoleLog = true
Field Value
| Type | Description |
|---|---|
| bool |
Methods
Consume(object, bool, bool)
Consumes the object data.
Declaration
public void Consume(object data, bool synchronous = false, bool isArtifact = true)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | data to be consumed. Generally a string representing a path. |
| bool | synchronous | If true, consumption will complete before returning. |
| bool | isArtifact | A flag indicating if object being consumed is artifact or not. |
ConsumptionStillInProgress()
Returns true if there is any consumption in progress.
Declaration
public bool ConsumptionStillInProgress()
Returns
| Type | Description |
|---|---|
| bool |
|
LocalPathToObjectPath(string)
Implementation for LocalPathToObjectPath must be implemented in derived class.
Declaration
public virtual string LocalPathToObjectPath(string localPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localPath | Local file system path. |
Returns
| Type | Description |
|---|---|
| string | The resulting string. |
Upload(string, string, bool)
Implementation for Upload must be implemented in derived class.
Declaration
public virtual bool Upload(string localPath, string objectPath, bool isArtifact)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localPath | Local file system path. |
| string | objectPath | Path to the asset or object. |
| bool | isArtifact | Whether this entry is a build artifact. |
Returns
| Type | Description |
|---|---|
| bool |
|
UploadAsync(Stream, string, bool)
Implementation for UploadAsync must be implemented in derived class.
Declaration
public virtual Task<T> UploadAsync(Stream source, string objectPath, bool isArtifact)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | source | Data source identifier or object. |
| string | objectPath | Path to the asset or object. |
| bool | isArtifact | Whether this entry is a build artifact. |
Returns
| Type | Description |
|---|---|
| Task<T> | The result. |
_ServiceName()
Gets the name of this consumer's concrete type, for logging.
Declaration
protected string _ServiceName()
Returns
| Type | Description |
|---|---|
| string | The name of the concrete consumer type. |