private bool UserJoinGroupMessagesEqual(UserJoinGroupMessage x, UserJoinGroupMessage y) { return(StringEqual(x.UserId, y.UserId) && StringEqual(x.GroupName, y.GroupName) && x.TracingId == y.TracingId && x.Ttl == y.Ttl); }
public Task UserAddToGroupAsync(string userId, string groupName, TimeSpan ttl, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(userId)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId)); } if (string.IsNullOrEmpty(groupName)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(groupName)); } if (ttl < TimeSpan.Zero) { throw new ArgumentOutOfRangeException(nameof(ttl), TtlOutOfRangeErrorMessage); } var message = new UserJoinGroupMessage(userId, groupName) { Ttl = (int)ttl.TotalSeconds }.WithTracingId(); if (message.TracingId != null) { MessageLog.StartToAddUserToGroup(Logger, message); } return(WriteAsync(message)); }
public static void StartToAddUserToGroup(ILogger logger, UserJoinGroupMessage message) { if (message.Ttl == null) { _startToAddUserToGroup(logger, message.TracingId, message.UserId, message.GroupName, null); } else { _startToAddUserToGroupWithTtl(logger, message.TracingId, message.UserId, message.GroupName, message.Ttl, null); } }
public Task UserAddToGroupAsync(string userId, string groupName, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(userId)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId)); } if (string.IsNullOrEmpty(groupName)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(groupName)); } var message = new UserJoinGroupMessage(userId, groupName); return(ServiceConnectionContainer.WriteAsync(message)); }
public Task UserAddToGroupAsync(string userId, string groupName, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(userId)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId)); } if (string.IsNullOrEmpty(groupName)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(groupName)); } var message = new UserJoinGroupMessage(userId, groupName).WithTracingId(); Log.StartToAddUserToGroup(Logger, message); return(WriteAsync(message)); }
public Task UserAddToGroupAsync(string userId, string groupName, TimeSpan ttl, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(userId)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(userId)); } if (string.IsNullOrEmpty(groupName)) { throw new ArgumentException(NullOrEmptyStringErrorMessage, nameof(groupName)); } if (ttl < TimeSpan.Zero) { throw new ArgumentOutOfRangeException(nameof(ttl), TtlOutOfRangeErrorMessage); } var message = new UserJoinGroupMessage(userId, groupName) { Ttl = (int)ttl.TotalSeconds }; return(ServiceConnectionContainer.WriteAsync(message)); }
private bool UserJoinGroupMessagesEqual(UserJoinGroupMessage x, UserJoinGroupMessage y) { return(StringEqual(x.UserId, y.UserId) && StringEqual(x.GroupName, y.GroupName)); }