Skip to content

Commit

Permalink
Refactor polling into a separate method
Browse files Browse the repository at this point in the history
  • Loading branch information
Avin Pattath committed Sep 20, 2024
1 parent 84504aa commit 9779fd0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ static async Task Main(string[] args)
var operationId = emailSendOperation.Id;
Console.WriteLine($"Email operation id = {operationId}");

/// Rehydrate an EmailSendOperation object using the operationId
/// Do a bunch of other things here...

/// Poll for the status of the email send operation using the previous operationId
await PollForEmailSendOperationStatus(emailClient, operationId);
}

private static async Task PollForEmailSendOperationStatus(EmailClient emailClient, string operationId)
{
/// Rehydrate a new EmailSendOperation object using the given operationId
EmailSendOperation rehydratedEmailSendOperation = new EmailSendOperation(operationId, emailClient);

/// Call UpdateStatus on the rehydrated email send operation to poll for the status manually.
Expand Down

0 comments on commit 9779fd0

Please sign in to comment.