using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using ZB.MOM.WW.LmxProxy.Client.Domain;
namespace ZB.MOM.WW.LmxProxy.Client
{
///
/// Interface for LmxProxy client operations
///
public interface ILmxProxyClient : IDisposable, IAsyncDisposable
{
///
/// Gets or sets the default timeout for operations
///
TimeSpan DefaultTimeout { get; set; }
///
/// Connects to the LmxProxy service
///
/// Cancellation token.
Task ConnectAsync(CancellationToken cancellationToken = default);
///
/// Disconnects from the LmxProxy service
///
Task DisconnectAsync();
///
/// Checks if the client is connected to the service
///
Task IsConnectedAsync();
///
/// Reads a single tag value
///
/// The tag address to read.
/// Cancellation token.
Task ReadAsync(string address, CancellationToken cancellationToken = default);
///
/// Reads multiple tag values in a single batch
///
/// The tag addresses to read.
/// Cancellation token.
Task> ReadBatchAsync(IEnumerable addresses, CancellationToken cancellationToken = default);
///
/// Writes a single tag value
///
/// The tag address to write.
/// The value to write.
/// Cancellation token.
Task WriteAsync(string address, object value, CancellationToken cancellationToken = default);
///
/// Writes multiple tag values in a single batch
///
/// The tag addresses and values to write.
/// Cancellation token.
Task WriteBatchAsync(IDictionary values, CancellationToken cancellationToken = default);
///
/// Subscribes to tag updates
///
/// The tag addresses to subscribe to.
/// Callback invoked when tag values change.
/// Cancellation token.
Task SubscribeAsync(IEnumerable addresses, Action onUpdate, CancellationToken cancellationToken = default);
///
/// Gets the current metrics snapshot
///
Dictionary GetMetrics();
}
}