using System;
using System.Threading;
using System.Threading.Tasks;
namespace RudderSdk.Unity
{
///
/// Interface for WebSocket transport adapters used by the realtime transport bridge.
/// Provides connect, send, close, and main-thread event dispatch for WebSocket connections.
///
public interface IWebSocketAdapter
{
event Action Closed;
event Action> Received;
event Action ReceivedError;
bool IsConnected { get; }
bool IsConnecting { get; }
Task ConnectAsync(Uri uri, int timeoutSeconds, CancellationToken cancellationToken = default);
Task CloseAsync();
Task SendAsync(ArraySegment data, CancellationToken cancellationToken = default);
}
}