public async Task CreateStreamAsync(string streamId) { // Create container Console.WriteLine($"Creating Container with Id {streamId}"); Console.WriteLine(); OmfContainerMessage containerMessage = OmfMessageCreator.CreateContainerMessage(streamId, typeof(DataPointType)); await SendOmfMessageAsync(containerMessage).ConfigureAwait(false); }
public async Task DeleteStreamAsync(string streamId) { // Delete container Console.WriteLine($"Deleting Container with Id {streamId}"); Console.WriteLine(); OmfContainerMessage containerMessage = OmfMessageCreator.CreateContainerMessage(streamId, typeof(DataPointType)); containerMessage.ActionType = ActionType.Delete; await SendOmfMessageAsync(containerMessage); }
/// <summary> /// Sends OMF container messages for a dictionary of OMF data keyed by the stream ID to the configured OMF endpoints /// </summary> /// <typeparam name="T">OMF type of the OMF data to be sent</typeparam> /// <param name="data">Dictionary of OMF data keyed by the stream ID</param> /// <param name="typeId">TypeID of the OMF type</param> internal void SendOmfContainersForData <T>(Dictionary <string, T> data, string typeId) { var containers = new List <OmfContainer>(); foreach (var streamId in data.Keys) { containers.Add(new OmfContainer(streamId, typeId)); } var msg = new OmfContainerMessage(containers); SendOmfMessage(msg); msg.ActionType = ActionType.Delete; _containerDeleteMessage = msg; }