Adds TPL based runTask to Deployment (#3858)

Add TPL based runTask to Deployment.
This commit is contained in:
Yves Reynhout 2020-05-01 16:21:37 +02:00 committed by GitHub
parent 93a7dbe412
commit f36a8b4ca0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -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)

View file

@ -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.