All Projects → TsurHerman → Signals.jl

TsurHerman / Signals.jl

Licence: MIT, Unknown licenses found Licenses found MIT LICENSE Unknown LICENSE.md
Multi-Paradigm Dynamic Fast Functional Reactive Programming in Julia

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Signals.jl

ImmediateReflection
.NET library that aims to provide faster usage of C# reflection features. Especially the usage of constructor and members accessors (get/set). It also provides an ObjectWrapper object allowing to use Reflection in a faster way. And finally it offers the possibility to create strongly typed delegates.
Stars: ✭ 30 (-18.92%)
Mutual labels:  fast, dynamic
Superstring
A fast and memory-optimized string library for C++
Stars: ✭ 252 (+581.08%)
Mutual labels:  fast
Wolff
🐺 Lightweight and easy to use framework for building web apps.
Stars: ✭ 203 (+448.65%)
Mutual labels:  fast
Bombardier
Fast cross-platform HTTP benchmarking tool written in Go
Stars: ✭ 2,952 (+7878.38%)
Mutual labels:  fast
Json
A C++11 or library for parsing and serializing JSON to and from a DOM container in memory.
Stars: ✭ 205 (+454.05%)
Mutual labels:  fast
Nonblocking
Implementation of a lock-free dictionary on .Net.
Stars: ✭ 237 (+540.54%)
Mutual labels:  fast
Amber
A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
Stars: ✭ 2,345 (+6237.84%)
Mutual labels:  fast
rainbow-bash-prompt
Make your bash prompt dynamically and randomly rainbow
Stars: ✭ 49 (+32.43%)
Mutual labels:  dynamic
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (+564.86%)
Mutual labels:  fast
Grab
experimental and very fast implementation of a grep
Stars: ✭ 230 (+521.62%)
Mutual labels:  fast
Ataraxia
Simple and lightweight source-based multi-platform Linux distribution with musl libc.
Stars: ✭ 226 (+510.81%)
Mutual labels:  fast
Dmd
dmd D Programming Language compiler
Stars: ✭ 2,498 (+6651.35%)
Mutual labels:  fast
Router
Router implementation for fasthttp
Stars: ✭ 234 (+532.43%)
Mutual labels:  fast
Store
A beautifully-simple framework-agnostic modern state management library.
Stars: ✭ 204 (+451.35%)
Mutual labels:  fast
Geokdbush
The fastest spatial index for geographic locations in JavaScript
Stars: ✭ 251 (+578.38%)
Mutual labels:  fast
Googliser
a fast BASH multiple-image downloader
Stars: ✭ 202 (+445.95%)
Mutual labels:  fast
Tensorflow Fast Style Transfer
A simple, concise tensorflow implementation of fast style transfer
Stars: ✭ 224 (+505.41%)
Mutual labels:  fast
Csv
[DEPRECATED] See https://github.com/p-ranav/csv2
Stars: ✭ 237 (+540.54%)
Mutual labels:  fast
mini-async-log-c
Mini async log C port. Now with C++ wrappers.
Stars: ✭ 69 (+86.49%)
Mutual labels:  fast
Pareto.js
An extremely small, intuitive and fast functional utility library for JavaScript
Stars: ✭ 254 (+586.49%)
Mutual labels:  fast

Signals

Build Status coveralls codecov.io

Signals provides a multi-paradigm fast functional reactive programing for julia. It supports both pull and push operations and async(default) and non-async modes.

Signal Creation

S = Signal(val;strict_push = false)

Create a source Signal with initial value val, setting strict_push to true guarantees that every push to this Signal will be carried out independently. otherwise if updates occur faster than what the eventloop can process, then only the last value before the eventloop kicks in will be used(default)

S = Signal(f,args...)

Creates a derived Signal who's value is f(args...) , args can be of any type, Signal args get replaced by their value before calling f(args...). reads best with with do notation(see example).

Syntax

S[] = val

sets the value of S to val without propagating the change to the rest of the signal graph, useful in pull based paradigm

S()

pull! Signal, pulling any changes in the Signal graph that affects S

S(val)

sets the value of S to val and pushes the changes along the Signal graph

S[]

gets the current value stored in S without pulling changes from the graph

Example

julia> A = Signal(1)   # source Signal
Signal
value: 1

julia> B = 2           # non-Signal input
2

julia>  C = Signal(A,B) do a,b   # derived Signal
            a+b
        end

Signal
value: 3

julia> A[] = 10        # set value without propagation
10
julia> C[]             # read current value
3
julia> C()             # pull latest changes from the Signal graph
12
julia> A(100)          # set value to a signal and propagate this change
100
julia> C[]
102

Operators

Signals supports several reactive operators

  • droprepeats
  • when
  • filter
  • sampleon
  • foldp
  • count
  • previous
  • merge
  • async_signal
  • remote_signal
  • bind!
  • unbind!

individual documentation files are available from within julia

Time operators

Signals supports several operators that takes time into consideration, for example debounce which executes only after a set amount of time has passed since the inputs were updated or throttle which creates a Signal that is guaranteed not to be executed more than set amount of times per second.

  • debounce
  • throttle
  • for_signal
  • fps
  • every
  • buffer

Async mode

By default Signals run asynchronically in a dedicated eventloop, this behavior can be changed using

Signals.async_mode(false)

or by individual non-async pushes to the signal graph using:

push!(s,val,false)

Dynamic

Signals is dynamic , one can push values of any type to a source signal

julia> using Signals
julia> A = Signal(1)
Signal
value: 1

julia> B = Signal(A,A) do a,b
       a*b
       end
Signal
value: 1

julia> A(rand(3,3));
julia> B()
3×3 Array{Float64,2}:
 0.753217  0.796031  0.265298
 0.28489   0.209641  0.249161
 0.980177  0.810512  0.571937

Fast

Signals package was rigorously optimized for speed of execution and minimal recalculation of signal graph updates.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].