Skip to content

Instantly share code, notes, and snippets.

@isaacabraham
Last active August 29, 2015 14:26
Show Gist options
  • Save isaacabraham/d50e47df28bac11ca38d to your computer and use it in GitHub Desktop.
Save isaacabraham/d50e47df28bac11ca38d to your computer and use it in GitHub Desktop.
Testing Service Fabric through FSX
#load "load-references.fsx"
#r @"..\bin\debug\Interfaces.dll"
open Microsoft.ServiceFabric.Actors
open ServiceFabricDemo
open System
let cat = ActorProxy.Create<ICat>(ActorId "Blackie", "fabric:/CatActors")
async {
do! cat.Eat "Whiskers" |> Async.AwaitTask
do! cat.Eat "Sheba" |> Async.AwaitTask
do! cat.Meow 3 (TimeSpan.FromHours 6.) |> Async.AwaitTask
do! cat.Purr() |> Async.AwaitTask
let! color = cat.Colour() |> Async.AwaitTask
let! food = cat.FavouriteFood() |> Async.AwaitTask
return sprintf "%s is %s and likes %s." (cat.GetActorId().GetStringId()) color food
} |> Async.RunSynchronously
(*
val it : string = "Blackie is Black and likes Sheba."
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment