Giter VIP home page Giter VIP logo

fork_join's Introduction

fork_join

The fork/join package is a parallel processing library for Pony. Fork/join handles much of the plumbing required to distribute a data processing tasks across multiple actors.

Status

fork_join is a beta-level project. The API might change going forward based on feedback from real-world usage.

Installation

  • Install corral
  • corral add github.com/ponylang/fork_join.git --version 0.1.1
  • corral fetch to fetch your dependencies
  • use "fork_join" to include this package
  • corral run -- ponyc to compile your application

API Documentation

https://ponylang.github.io/fork_join

fork_join's People

Contributors

ponylang-main avatar seantallen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

seanpm2001

fork_join's Issues

Make examples more didactic

The examples are used as tests to validate the fork/join pattern, but they can be made more didactic for Pony learners.

For instance, all examples output the completion of the join by writing the result in the Collector finish function, but frequently one will need to get that result into the actor that initiated the fork/join process. So instead of printing the output in the Collector, having the example outputting the result in Main actor would show how the result can be sent back to the initiator.

Also, inserting Debug with digestof this into the functions of the three classes *Worker, *Generator and *Collector of the examples would show the users who run those examples in debug mode how the work is split between multiple actors and get collected at the end.

Sample for process-array.pony

class Adder is fj.Worker[Array[U8] iso, USize]
  var _working_set: Array[U8] = _working_set.create()

  fun ref receive(work_set: Array[U8] iso) =>
    Debug("Adder #" + (digestof this).string() + " receiving work to do")
    _working_set = consume work_set

  fun ref process(runner: fj.WorkerRunner[Array[U8] iso, USize] ref) =>
    Debug("Adder #" + (digestof this).string() + " doing work")
    var total: USize = 0

    for i in _working_set.values() do
      total = total + i.usize()
    end

    Debug("Adder #" + (digestof this).string() + " completed work")
    runner.deliver(total)

Last, adding how to use the word-count.pony example in case of launch error is more user friendly than reporting an error:

      env.exitcode(-1)
      env.err.print("Error during setup.")
      env.err.print("Usage: word-count <filename>")

Release 0.1.0

0.1.0 can be released once the runtime_info package is available in a released version of ponyc.

Pre-release tasks:

  • Manually generate documentation and review on GH pages site to make sure the formatting is good. Update as needed until we are "ready for release".
  • Add "Initial Release" changelog entry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.