All Projects → mostafa-asg → dag

mostafa-asg / dag

Licence: Unlicense license
Simple DSL for executing functions in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to dag

ipld-explorer-cli
🔎 Explore the IPLD directed acyclic graph with your keyboard
Stars: ✭ 22 (-74.12%)
Mutual labels:  dag, directed, acyclic
aircal
Visualize Airflow's schedule by exporting future DAG runs as events to Google Calendar.
Stars: ✭ 66 (-22.35%)
Mutual labels:  dag
SurrealNumbers.jl
Implementation of Conway's Surreal Numbers
Stars: ✭ 30 (-64.71%)
Mutual labels:  dag
xdagj
XDAGJ is an implementation of XDAG in Java. https://xdag.io
Stars: ✭ 81 (-4.71%)
Mutual labels:  dag
Tanglestash
IOTA meets BitTorrent: An algorithm to persist any file onto the tangle of IOTA
Stars: ✭ 46 (-45.88%)
Mutual labels:  dag
Slack-Stock-DAG
This repository holds a list of cool resources for Silica.
Stars: ✭ 94 (+10.59%)
Mutual labels:  dag
scattersphere
Job Coordination API for Tasks
Stars: ✭ 30 (-64.71%)
Mutual labels:  dag
algorithms
Algorithms in python and C
Stars: ✭ 71 (-16.47%)
Mutual labels:  dag
hamilton
A scalable general purpose micro-framework for defining dataflows. You can use it to create dataframes, numpy matrices, python objects, ML models, etc.
Stars: ✭ 612 (+620%)
Mutual labels:  dag
metahelm
Install dependency graphs of Kubernetes Helm Charts
Stars: ✭ 70 (-17.65%)
Mutual labels:  dag
ent
No description or website provided.
Stars: ✭ 33 (-61.18%)
Mutual labels:  dag
primrose
Primrose modeling framework for simple production models
Stars: ✭ 33 (-61.18%)
Mutual labels:  dag
ipfs-dag-builder-vis
See how the DAGs get built
Stars: ✭ 19 (-77.65%)
Mutual labels:  dag
breaking cycles in noisy hierarchies
breaking cycles in noisy hierarchies
Stars: ✭ 59 (-30.59%)
Mutual labels:  dag
obyte-hub
Hub for Obyte network
Stars: ✭ 17 (-80%)
Mutual labels:  dag
bigflow
A Python framework for data processing on GCP.
Stars: ✭ 96 (+12.94%)
Mutual labels:  dag
DaggerGpuMiner
Standalone GPU/CPU miner for Dagger coin
Stars: ✭ 21 (-75.29%)
Mutual labels:  dag
go-pdu
Parallel Digital Universe - A decentralized social networking service
Stars: ✭ 39 (-54.12%)
Mutual labels:  dag
hathor-core
HathorNetwork's fullnode core
Stars: ✭ 57 (-32.94%)
Mutual labels:  dag
react-monitor-dag
A React-based operation/monitoring DAG diagram.(基于React的运维/监控DAG图)
Stars: ✭ 57 (-32.94%)
Mutual labels:  dag

dag has two main concept:

  1. Pipeline executes the functions sequentially and in order.
  2. Spawns executes the functions concurrently, so there is no ordering guarantee.

Example 1

example1

d := dag.New()
d.Pipeline(f1, f2, f3)
d.Run()

In the above example, f1 starts first, and after completion, f2 starts then f3.
Full example : examples/ex1/ex1.go

Example 2

example2

d := dag.New()
d.Spawns(f1, f2, f3)
d.Run()

The order of execution of f1, f2 and f3 is nondeterministic
Full example : examples/ex2/ex2.go

Example 3

example3
In this example f4 must be executed after complition of f1, f2 and f3. You can use Join method:

d := dag.New()
d.Spawns(f1, f2, f3).Join().Pipeline(f4)
d.Run()

Full example : examples/ex3/ex3.go

Example 4

example4
After pipeline we can use Then method:

d := dag.New()
d.Pipeline(f1, f2, f3).Then().Spawns(f4, f5, f6)
d.Run()

Full example : examples/ex4/ex4.go

Example 5

example5

d := dag.New()
d.Spawns(f1, f2, f3).
	Join().
	Pipeline(f4, f5).
	Then().
	Spawns(f6, f7, f8)
d.Run()

Full example : examples/ex5/ex5.go

Example 6

example6
We want to execute two pipeline concrrently, we can use pipeline.Of inside the Spawns method:

d := dag.New()
d.Spawns(pipeline.Of(f1, f3), pipeline.Of(f2, f4)).
	Join().
	Pipeline(f5)
d.Run()

Full example : examples/ex6/ex6.go

Example 7

We can use OnComplete method after Pipeline or Spawns to notify when functions has completed.

d := dag.New()
d.Pipeline(f1, f2).OnComplete(f3).
	  Then().
  Spawns(f1, f2).OnComplete(f4)
d.Run()

Full example : examples/ex7/ex7.go

Example 8

Basically, Run() will block until all functions are done. If you don't want to be blocked, you can use RunAsync() method. It accepts a callback function, that will be called when all functions are done.

d := dag.New()
d.Pipeline(f1, f2).Then().Spawns(f3, f4)
d.RunAsync(onComplete)

Full example : examples/ex8/ex8.go

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].