Vagabond


API Overview

The included implementation of ThunkServer is a straightforward distributed implementation that makes use of Vagabond. What follows is a brief overview of the basic API.

A Vagabond environment can be initialized as follows:

1: 
2: 
3: 
open MBrace.Vagabond

let vmanager = Vagabond.Initialize(cacheDirectory = "/tmp/vagabond")

Given an arbitrary object, dependencies are resolved like so:

1: 
2: 
3: 
let value = [ Some(fun x -> printfn "%d" x; x + 1) ; None ; Some id ]

let assemblies = vmanager.ComputeObjectDependencies(value, permitCompilation = true)

An assembly can be exported by generating Vagabond metadata

1: 
let vagabondAssembly = vmanager.GetVagabondAssembly assembly

An assembly package contains necessary data to load the specified assembly in a remote process.

Assemblies can be loaded in a remote process like so:

1: 
let response = vmanager.LoadVagabondAssembly vagabondAssembly

Communication

Once all required dependencies have been loaded, communication can be established by using the .Serializer property found in both the server and client instances. These give an FsPickler serializer instance that is capable of serializing and deserializing objects depending on dynamic assemblies.

1: 
2: 
3: 
let serializer = vmanager.Serializer

let bytes = serializer.Pickle(value)
Fork me on GitHub