Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "chan"

Title:Directional channels for thread communication
Rating:Not rated. Create the first rating!
Latest version:0.2.0
SHA1 sum:2a19a9ebc6b4e2b9b9527dfd7aef4270ff935f82
Author:Michael Hendricks <michael@ndrix.org>
Maintainer:Michael Hendricks <michael@ndrix.org>
Packager:Michael Hendricks <michael@ndrix.org>
Home page:https://github.com/mndrix/chan
Download URL:https://github.com/mndrix/chan/archive/v0.2.0.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.2.02a19a9ebc6b4e2b9b9527dfd7aef4270ff935f8236https://github.com/mndrix/chan/archive/v0.2.0.zip

Synopsis

:- use_module(library(chan),[]).
?-  chan:new(Tx,Rx),
    chan:send(Tx, hello),
    chan:recv(Rx, Message).
Message = hello .

Description

SWI-Prolog has great primitives for communicating between threads. This library is for applications which prefer a directional channel abstraction similar to that used in Go or Rust.

This is a relatively thin API on top of SWI-Prolog's message queues.

Installation

Using SWI-Prolog 7.1 or later:

?- pack_install(chan).

This module uses semantic versioning.

Source code available and pull requests accepted at http://github.com/mndrix/chan

Contents of pack "chan"

Pack contains 7 files holding a total of 7.2K bytes.