/// <summary> /// Sends OMF type message for a type /// </summary> /// <param name="type">OMF type to be sent</param> internal void SendOmfType(Type type) { OmfTypeMessage msg = OmfMessageCreator.CreateTypeMessage(type); SendOmfMessage(msg); msg.ActionType = ActionType.Delete; _typeDeleteMessage = msg; }
/// <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) { List <OmfContainer> containers = new (); foreach (string streamId in data.Keys) { containers.Add(new OmfContainer(streamId, typeId)); } OmfContainerMessage msg = new (containers); SendOmfMessage(msg); msg.ActionType = ActionType.Delete; _containerDeleteMessage = msg; }
/// <summary> /// Sends a message to the configured OMF endpoints /// </summary> /// <param name="omfMessage">The OMF message to send</param> internal void SendOmfMessage(OmfMessage omfMessage) { SerializedOmfMessage serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage); if (AdhHttpClient != null) { _ = SendOmfMessageAsync(serializedOmfMessage, AdhHttpClient).Result; } if (EdsHttpClient != null) { _ = SendOmfMessageAsync(serializedOmfMessage, EdsHttpClient).Result; } if (PiHttpClient != null) { _ = SendOmfMessageAsync(serializedOmfMessage, PiHttpClient).Result; } }
private async Task SendOmfMessageAsync(OmfMessage omfMessage) { SerializedOmfMessage serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage); await _deviceOmfIngressService.SendOMFMessageAsync(serializedOmfMessage); }
private async Task SendOmfMessageAsync(OmfMessage omfMessage) { SerializedOmfMessage serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage); await _deviceOmfIngressService.SendOmfMessageAsync(serializedOmfMessage).ConfigureAwait(false); }
/// <summary> /// Sends a message to the OCS OMF endpoint /// </summary> private static object SendOmfMessage(IOmfIngressService service, OmfMessage omfMessage) { var serializedOmfMessage = OmfMessageSerializer.Serialize(omfMessage); return(service.SendOmfMessageAsync(serializedOmfMessage).Result); }