protected async Task SendMessage(SynchronizeMessage syncMessage) { if (Wait) { var message = await Root.Connection.Queue.EnqueueWithCallbackWait("SynchronizeManager", syncMessage, Timeout); syncMessage = JsonConvert.DeserializeObject <SynchronizeMessage>(message.Message); Table("Sync Result", syncMessage); } else { await Root.Connection.Queue.EnqueueAsync("SynchronizeManager", syncMessage); } }
private async Task ScheduleEntry() { var organizations = await API.Organization.GetAllAsync(); foreach (var organization in organizations.Rows .Where(o => o.Read <bool>("synchronize[isActive]", defaultValue: false))) { var message = new SynchronizeMessage { OrganizationIdentifier = organization.Identifier, Component = "Delta" }; var response = await API.Queue.EnqueueWithCallbackWait(Configuration.QueueNameManager, message, Configuration.ScheduleEntryTimeout); message = JsonConvert.DeserializeObject <SynchronizeMessage>(response.Message); this.CurrentMessage.Result = (this.CurrentMessage.Result ?? string.Empty) + message.Result; } }