Coder Social home page Coder Social logo

feedback's Introduction

feedback

Control theory applied to core.async. Following examples and discussion from the "Feedback Control for Computer Systems" book published by O'Reilly.

Usage

Coming soon ;)

Creating a process

A process consumes values from an input channel and produces output for an output channel. feedback.processes aims to make this a little easier:

(ns user
  (:require [feedback.processes :refer (defprocess)]
            [core.async :refer (<! >! go-loop)]))
  
(defprocess say-hello [in-ch out-ch]
  (go-loop [m (<! in-ch)]
    (when m
      (>! out-ch (str "Hello" m))
      (recur (<! in-ch)))))

;; start the process
(say-hello)

;; consume the process output
(go-loop [m (<! say-hello)]
  (when m
    (println "Received:" m)
    (recur (<! say-hello))))

;; put some values to be handled by our say-hello process
(put! say-hello "Peter")
(put! say-hello "Paul")

To do:

  • Process chaining
  • Channel re-wiring for process dependencies

License

Copyright © 2014 Paul Ingles

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

feedback's People

Contributors

pingles avatar

Stargazers

Owain Lewis avatar

Watchers

 avatar James Cloos avatar

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.