Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Diagnostics;

namespace StreamChat.Core.LowLevelClient
{
/// <summary>
/// Elapsed-time source for the per-frame event drain budget. Production uses
/// <see cref="DiagnosticsElapsedStopwatch"/>; tests inject a fake so pacing is deterministic.
/// </summary>
internal interface IElapsedStopwatch
{
void Restart();

double ElapsedMilliseconds { get; }
}

internal sealed class DiagnosticsElapsedStopwatch : IElapsedStopwatch
{
public void Restart() => _stopwatch.Restart();

public double ElapsedMilliseconds => _stopwatch.Elapsed.TotalMilliseconds;

private readonly Stopwatch _stopwatch = new Stopwatch();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ void SetReconnectStrategySettings(ReconnectStrategy reconnectStrategy, float? ex
[Obsolete("Use DisconnectAsync(DisconnectCause). true maps to UserLogout, false to ConnectionReleased.")]
Task DisconnectAsync(bool permanent);

/// <summary>
/// Fetch missed events via <c>/sync</c> and apply them. The returned task completes when
/// those events have been processed, which may span several <see cref="Update"/> calls
/// after a large catch-up. Keep calling <see cref="Update"/> while awaiting.
/// </summary>
Task FetchAndProcessEventsSinceLastReceivedEvent(IEnumerable<string> channelCids);

/// <summary>
Expand Down
Loading
Loading