fszmq is an MPLv2-licensed F# binding for the ZeroMQ distributed computing library. It provides a complete binding to versions 2.1.x, 3.2.x, and 4.0.x of ZeroMQ (Note: each binding is a separate branch in git, as there are some non-compatible differences). This library is primarily designed to be consumed from F#. However, where possible, the library has been designed to appear "friendly" when consumed by other CLR languages (C#, et aliam).

The fszmq library can be installed from NuGet:
PM> Install-Package fszmq

Getting Started

The simplest thing we can do with fszmq is print the ZeroMQ version. That is, we can display the version, which is not fixed at compile-time, of the native library (i.e. libzmq) against which fszmq.dll is current bound. (Note: the version of fszmq.dll, itself, may be retrieved via the normal mechanisms for CLR libraries.)

#r "fszmq.dll"
open fszmq

printfn "libzmq version: %A" ZMQ.version

Running this code should produce something like the following (the actual numbers may be different on your machine):

libzmq version: 4.1.3

Samples & Documentation

This library features API documentation, and an ever-growing collection of samples. Most of these narrative-style examples are also executable F# scripts, and may be found in the content folder (Hint: look for files ending in .fsx).

In particular, please review:

  • Client/Server Tutorial ... contains a more complete, but simplistic, example of fszmq in action.

  • API Reference ... contains automatically generated documentation for all types, modules, and functions in the library. This includes additional brief samples on using some of the functionality.

Additionally, general information about ZeroMQ maybe found at http://zero.mq. And the zguide is a well-written, exhaustive explanation of the library. It should definitely be read. And then read again. Also, while the zguide features examples in many languages, the F#-specific zguide code samples have been collected here as a convenience.

Contributing & Licensing

The project is hosted on GitHub where you can report issues (or, better yet, fork the project and submit pull requests. If you're adding a new public API, please also consider adding samples that can be turned into help docs. Also be sure to read the contributor notes before getting started.)

The fszmq library is available under the Mozilla Public License, v. 2.0. For more information see the license file in the GitHub repository.

The documentation accompanying fszmq, and any sample code contained therein, is available under the MIT LICENSE which allows modification and reuse for both commercial non-commercial purposes. For more information see the documentation license file in the GitHub repository.

module docs
module PATH

from docs
val hijack : unit -> unit

Full name: docs.PATH.hijack
namespace fszmq
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
val release : unit -> unit

Full name: docs.PATH.release
Fork me on GitHub