Skip to content

Instantly share code, notes, and snippets.

View lenadroid's full-sized avatar

Lena lenadroid

View GitHub Profile
/// Cloud workflow expression builder
type CloudBuilder () =
member __.Return (t : 'T) = ...
member __.Zero () = ...
member __.Delay (f : unit -> Cloud<'T>) : Cloud<'T> = ...
member __.ReturnFrom (c : Cloud<'T>) = ...
member __.Combine(f : Cloud<unit>, g : Cloud<'T>) = ...
member __.Bind (f : Cloud<'T>, g : 'T -> Cloud<'S>) : Cloud<'S> = bind f g
member __.Using<'T, 'U, 'p when 'T :> IDisposable>(value : 'T, bindF : 'T -> Cloud<'U>) : Cloud<'U> = ...
member __.Using<'T, 'U when 'T :> ICloudDisposable>(value : 'T, bindF : 'T -> Cloud<'U>) : Cloud<'U> = ...
@lenadroid
lenadroid / Cloud.Parallel.fs
Created May 14, 2015 11:27
Cloud.Parallel
static member Parallel (computations : seq<Cloud<'T>>) : Cloud<'T []> = cloud {
let! runtime = Cloud.GetResource<IRuntimeProvider> ()
let workflow = runtime.ScheduleParallel (computations |> Seq.map (fun c -> c,None))
return! Cloud.WithAppendedStackTrace "Cloud.Parallel[T](seq<Cloud<T>> computations)" workflow
}
@lenadroid
lenadroid / configuration.xml
Last active August 29, 2015 14:21
mbraced.exe.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- hostname that uniquely and globally identifies the host machine of the daemon. This can be an IP address. -->
<add key="hostname" value="" />
<!--- IP addresses the daemon will listen on. Separate with commas. If empty then the daemon will listen on all local interfaces. -->
<!-- <add key="listen ips" value="192.168.1.10, 10.10.10.10"/> -->
<!-- Primary TCP port -->
<add key="primary port" value="2675" />
<!-- available ports for mbrace workers. e.g: 30000-30042 -->
@lenadroid
lenadroid / nodes.fs
Created May 14, 2015 15:36
Nodes MBrace IPs
let nodes =
[
MBraceNode.Connect("10.0.1.4", 2675)
MBraceNode.Connect("10.0.1.5", 2675)
MBraceNode.Connect("10.0.1.6", 2675)
]
@lenadroid
lenadroid / nodes.fs
Created May 14, 2015 15:43
Nodes MBrace hostnames
let nodes =
[
MBraceNode.Connect("hostname1", 2675)
MBraceNode.Connect("hostname1", 2675)
MBraceNode.Connect("hostname1", 2675)
]
MBraceSettings.DefaultStore <- AzureStore.Create(accountName = "your name", accountKey = "your key")
MBraceSettings.DefaultStore <- FileSystemStore.Create @"\\path\to\shared"
let config =
{
Configuration.Default with
StorageConnectionString = "<storage connection string>"
ServiceBusConnectionString = "<service bus connection string>"
}
let runtime = Runtime.GetHandle(config)
let runtime = MBrace.Boot nodeslet runtime = MBrace.Boot(nodes, store = azureStore)