Adds TPL based runTask to Deployment (#3858)
Add TPL based runTask to Deployment.
This commit is contained in:
parent
93a7dbe412
commit
f36a8b4ca0
|
@ -3,6 +3,9 @@ CHANGELOG
|
|||
|
||||
## HEAD (Unreleased)
|
||||
|
||||
- Add runTask to F# Deployment module
|
||||
[#3858](https://github.com/pulumi/pulumi/pull/3858)
|
||||
|
||||
- Add support for generating Fish completions
|
||||
[#4401](https://github.com/pulumi/pulumi/pull/4401)
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ module Ops =
|
|||
/// </summary>
|
||||
module Deployment =
|
||||
open System.Collections.Generic
|
||||
open System.Threading.Tasks
|
||||
|
||||
/// <summary>
|
||||
/// Runs a function as a Pulumi <see cref="Deployment" />.
|
||||
|
@ -59,6 +60,15 @@ module Deployment =
|
|||
|> Async.AwaitTask
|
||||
|> Async.RunSynchronously
|
||||
|
||||
/// <summary>
|
||||
/// Runs a task function as a Pulumi <see cref="Deployment" />.
|
||||
/// Blocks internally until the provided function completes,
|
||||
/// so that this function could be used directly from the main function.
|
||||
/// </summary>
|
||||
let runTask (f: unit -> Task<IDictionary<string, obj>>) =
|
||||
Deployment.RunAsync (fun () -> f())
|
||||
|> Async.AwaitTask
|
||||
|> Async.RunSynchronously
|
||||
|
||||
/// <summary>
|
||||
/// Module containing utility functions to work with <see cref="Output{T}" />'s.
|
||||
|
|
Loading…
Reference in a new issue