public async Task <PublishInfo> PublishAsync(IQuidjiboCommand command, string queueName, int delay, CancellationToken cancellationToken = default(CancellationToken)) { var payload = await _payloadSerializer.SerializeAsync(command, cancellationToken); var protectedPayload = await _payloadProtector.ProtectAsync(payload, cancellationToken); var item = new WorkItem { Id = Guid.NewGuid(), CorrelationId = Guid.NewGuid(), Name = command.GetName(), Attempts = 0, Payload = protectedPayload, Queue = queueName }; var provider = await GetOrCreateWorkProvider(queueName, cancellationToken); await provider.SendAsync(item, delay, cancellationToken); return(new PublishInfo(item.Id, item.CorrelationId)); }