You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Framework/Connected.Net/Hubs/Message.cs

23 lines
556 B

namespace Connected.Net.Hubs
{
public sealed class Message<TArgs>
{
private static ulong _identity = 0UL;
public Message(Client<TArgs> client, TArgs args)
{
Client = client;
Arguments = args;
Id = Interlocked.Increment(ref _identity);
Expire = DateTime.UtcNow.AddMinutes(5);
}
public Client<TArgs> Client { get; }
public ulong Id { get; }
public string? Key { get; set; }
public TArgs? Arguments { get; }
public DateTime NextVisible { get; set; } = DateTime.UtcNow.AddSeconds(5);
public DateTime Expire { get; }
}
}