[Docs] Adding code snippet tags (#1132)

* Adding code snippet tags
This commit is contained in:
Glenn Gailey 2022-10-19 15:02:23 -07:00 коммит произвёл GitHub
Родитель 2b7986b81e
Коммит c12ea97800
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -17,6 +17,7 @@ namespace Net7Worker
// Sample showing how to handle a cancellation token being received
// In this example, the function invocation status will be "Cancelled"
//<docsnippet_cancellation_token_throw>
[Function(nameof(ThrowOnCancellation))]
public async Task ThrowOnCancellation(
[EventHubTrigger("sample-workitem-1", Connection = "EventHubConnection")] string[] messages,
@ -32,9 +33,11 @@ namespace Net7Worker
_logger.LogInformation("Message '{msg}' was processed.", message);
}
}
//</docsnippet_cancellation_token_throw>
// Sample showing how to take precautionary/clean up actions if a cancellation token is received
// In this example, the function invocation status will be "Successful"
//<docsnippet_cancellation_token_cleanup>
[Function(nameof(HandleCancellationCleanup))]
public async Task HandleCancellationCleanup(
[EventHubTrigger("sample-workitem-2", Connection = "EventHubConnection")] string[] messages,
@ -57,5 +60,6 @@ namespace Net7Worker
_logger.LogInformation("Message '{msg}' was processed.", message);
}
}
//</docsnippet_cancellation_token_cleanup>
}
}