Skip to content

Instantly share code, notes, and snippets.

@snowmantw
Created July 23, 2012 01:34
Show Gist options
  • Save snowmantw/3161609 to your computer and use it in GitHub Desktop.
Save snowmantw/3161609 to your computer and use it in GitHub Desktop.
DESL of asynchronous computation.
Compute
.init( {:Xa => xa, :domain => domain, :uid => uid} )
.wait("resource.scalar_product.Ra_ra",:Ra, :ra) #1.
.compute(:Xa_, lambda{ |m| add(m[:Xa], m[:Ra], m[:domain]) } ) #2.
.send("resource.scalar_product.Xa_", :Xa_) #3.
.wait("resource.scalar_product.Xb_", :Xb_) #4.
.wait("resource.scalar_product.t", :t) #5.
.compute( :yA, lambda{ |m| t1 = trans(m[:Xb_], m[:domain])
t2 = mul(m[:Ra],t1, m[:domain])
t3 = sub(m[:t] ,t2, m[:domain]) }) #6.
.done()
.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment