Skip to content

Instantly share code, notes, and snippets.

View lenadroid's full-sized avatar

Lena lenadroid

View GitHub Profile
let atomicValue = CloudAtom.New(42) |> cluster.Run
cloud {
do!
[ for i in 1..n -> cloud { return! CloudAtom.Update (atomicValue , fun i -> i + 1)}]
|> Cloud.Parallel
|> Cloud.Ignore
return! CloudAtom.Read atomicValue
} |> runtime.Run
cloud {
let value = ref 0
Cloud.Parallel [| for i in 1 .. 10000 -> cloud { incr value } |] |> ignore
return !value
} |> runtime.Run
async {
let value = ref 0
let parallel = Async.Parallel [| for i in 1 .. 10000 -> async { incr value } |]
return !value
} |> Async.RunSynchronously
let cloudVector = CloudVector.New(localArray,1000L) |> runtime.Run
cloud {
let! dataFromCloudCell = CloudCell.Read dataInTheCloud
// actions with data
}
let dataInTheCloud = localData |> CloudCell.New |> runtime.Run
let runtime = MBrace.Boot nodes
let runtime = MBrace.Boot nodeslet runtime = MBrace.Boot(nodes, store = azureStore)
let runtime = Runtime.GetHandle(config)
let config =
{
Configuration.Default with
StorageConnectionString = "<storage connection string>"
ServiceBusConnectionString = "<service bus connection string>"
}