MBrace.Core and MBrace.Azure


 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
#I __SOURCE_DIRECTORY__
#I "../packages/MBrace.Thespian/tools" 
#I "../packages/Streams/lib/net45" 
#r "../packages/Streams/lib/net45/Streams.dll"
#I "../packages/MBrace.Flow/lib/net45" 
#r "../packages/MBrace.Flow/lib/net45/MBrace.Flow.dll"
#load "../packages/MBrace.Thespian/MBrace.Thespian.fsx"

namespace global

module Config = 

    open MBrace.Core
    open MBrace.Runtime
    open MBrace.Thespian

    // change to alter cluster size
    let private workerCount = 4
    
    let mutable private thespian = None
    /// Gets or creates a new Thespian cluster session.
    let GetCluster() = 
        match thespian with 
        | None -> 
            let cluster = 
                ThespianCluster.InitOnCurrentMachine(workerCount, 
                                                     logger = new ConsoleLogger(), 
                                                     logLevel = LogLevel.Info)
            thespian <- Some cluster
        | Some t -> ()
        thespian.Value

    /// Kills the current cluster session
    let KillCluster() =
        match thespian with
        | None -> ()
        | Some t -> t.KillAllWorkers() ; thespian <- None
module Config
namespace MBrace
namespace MBrace.Core
namespace MBrace.Runtime
namespace MBrace.Thespian
val private workerCount : int

Full name: Config.workerCount
val mutable private thespian : ThespianCluster option

Full name: Config.thespian
union case Option.None: Option<'T>
val GetCluster : unit -> ThespianCluster

Full name: Config.GetCluster


 Gets or creates a new Thespian cluster session.
val cluster : ThespianCluster
type ThespianCluster =
  inherit MBraceClient
  private new : state:ClusterState * logLevel:LogLevel option * defaultFaultPolicy:FaultPolicy option -> ThespianCluster
  private new : state:ClusterState * manager:IRuntimeManager * defaultFaultPolicy:FaultPolicy option -> ThespianCluster
  member AttachNewLocalWorkers : workerCount:int * ?logLevel:LogLevel * ?quiet:bool -> unit
  member AttachWorker : worker:ThespianWorker -> unit
  member DetachWorker : worker:IWorkerRef -> unit
  member KillAllWorkers : unit -> unit
  member KillWorker : worker:IWorkerRef -> unit
  member IsWorkerHosted : bool
  member MasterNode : ThespianWorker option
  ...

Full name: MBrace.Thespian.ThespianCluster
static member ThespianCluster.InitOnCurrentMachine : workerCount:int * ?hostClusterStateOnCurrentProcess:bool * ?fileStore:MBrace.Core.Internals.ICloudFileStore * ?faultPolicy:MBrace.Core.FaultPolicy * ?resources:MBrace.Core.Internals.ResourceRegistry * ?quiet:bool * ?logger:ISystemLogger * ?logLevel:LogLevel -> ThespianCluster
type ConsoleLogger = ConsoleLogger

Full name: MBrace.Thespian.ConsoleLogger
Multiple items
module LogLevel

from MBrace.Runtime

--------------------
type LogLevel = LogLevel

Full name: MBrace.Thespian.LogLevel
LogLevel.Info: LogLevel = 4
union case Option.Some: Value: 'T -> Option<'T>
val t : ThespianCluster
property Option.Value: ThespianCluster
val KillCluster : unit -> unit

Full name: Config.KillCluster


 Kills the current cluster session
member ThespianCluster.KillAllWorkers : unit -> unit
Fork me on GitHub