Skip to content

Instantly share code, notes, and snippets.

@nikhan
Created February 3, 2015 20:52
Show Gist options
  • Save nikhan/816cd1f6bdfcf6af5108 to your computer and use it in GitHub Desktop.
Save nikhan/816cd1f6bdfcf6af5108 to your computer and use it in GitHub Desktop.
curl localhost:7071/blocks -d '{"type":"+"}' #1
curl localhost:7071/blocks -d '{"type":"first"}' #2
curl localhost:7071/blocks -d '{"type":"sink"}' #3
curl localhost:7071/blocks -d '{"type":"latch"}' #4
curl localhost:7071/blocks -d '{"type":"log"}' #5
curl localhost:7071/blocks -d '{"type":"identity"}' #6
curl -X PUT localhost:7071/blocks/2/routes/0 -d '{"type":"const","value":true}'
curl -X PUT localhost:7071/blocks/4/routes/0 -d '{"type":"const","value":0}'
curl -X PUT localhost:7071/blocks/1/routes/1 -d '{"type":"const","value":1}'
curl localhost:7071/connections -d '{"source":{"id":2,"route":0},"target":{"id":4,"route":1}}'
curl localhost:7071/connections -d '{"source":{"id":4,"route":1},"target":{"id":3,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":4,"route":0},"target":{"id":1,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":1,"route":0},"target":{"id":6,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":6,"route":0},"target":{"id":1,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":1,"route":0},"target":{"id":5,"route":0}}'
@nikhan
Copy link
Author

nikhan commented Feb 3, 2015

screen shot 2015-02-03 at 3 55 08 pm

@nikhan
Copy link
Author

nikhan commented Feb 3, 2015

if you remove sink the whole thing becomes slightly more elegant because the latch/first blocks will block forever after delivering a single message.

@nikhan
Copy link
Author

nikhan commented Feb 3, 2015

curl localhost:7071/blocks -d '{"type":"+"}'        #1
curl localhost:7071/blocks -d '{"type":"first"}'    #2
curl localhost:7071/blocks -d '{"type":"latch"}'    #4
curl localhost:7071/blocks -d '{"type":"log"}'      #5
curl localhost:7071/blocks -d '{"type":"identity"}' #6

curl -X PUT localhost:7071/blocks/2/routes/0 -d '{"type":"const","value":true}'
curl -X PUT localhost:7071/blocks/3/routes/0 -d '{"type":"const","value":0}'
curl -X PUT localhost:7071/blocks/1/routes/1 -d '{"type":"const","value":1}'

curl localhost:7071/connections -d '{"source":{"id":2,"route":0},"target":{"id":3,"route":1}}'
curl localhost:7071/connections -d '{"source":{"id":3,"route":0},"target":{"id":1,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":1,"route":0},"target":{"id":5,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":5,"route":0},"target":{"id":1,"route":0}}'
curl localhost:7071/connections -d '{"source":{"id":1,"route":0},"target":{"id":4,"route":0}}'

@nikhan
Copy link
Author

nikhan commented Feb 3, 2015

screen shot 2015-02-03 at 4 11 22 pm

@nikhan
Copy link
Author

nikhan commented Feb 25, 2015

curl localhost:7071/blocks -d '{"type":"+"}'        #1
curl localhost:7071/blocks -d '{"type":"first"}'    #2
curl localhost:7071/blocks -d '{"type":"latch"}'    #3
curl localhost:7071/blocks -d '{"type":"log"}'      #4
curl localhost:7071/blocks -d '{"type":"identity"}' #5
curl localhost:7071/blocks -d '{"type":"delay"}'    #6
curl localhost:7071/blocks -d '{"type":"sink"}'     #7

curl -X PUT localhost:7071/blocks/2/routes/0 -d '{"data":true}'
curl -X PUT localhost:7071/blocks/3/routes/0 -d '{"data":0}'
curl -X PUT localhost:7071/blocks/1/routes/1 -d '{"data":1}'
curl -X PUT localhost:7071/blocks/6/routes/1 -d '{"data":"500ms"}'

curl localhost:7071/connections -d '{"from":{"id":2,"route":0},"to":{"id":3,"route":1}}'
curl localhost:7071/connections -d '{"from":{"id":3,"route":0},"to":{"id":1,"route":0}}'
curl localhost:7071/connections -d '{"from":{"id":1,"route":0},"to":{"id":5,"route":0}}'
curl localhost:7071/connections -d '{"from":{"id":5,"route":0},"to":{"id":1,"route":0}}'
curl localhost:7071/connections -d '{"from":{"id":1,"route":0},"to":{"id":4,"route":0}}'
curl localhost:7071/connections -d '{"from":{"id":1,"route":0},"to":{"id":6,"route":0}}'
curl localhost:7071/connections -d '{"from":{"id":6,"route":0},"to":{"id":7,"route":0}}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment