Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Created February 27, 2010 03:23
Show Gist options
  • Save tmpvar/316442 to your computer and use it in GitHub Desktop.
Save tmpvar/316442 to your computer and use it in GitHub Desktop.
performer data structures
// performance (simplified)
{
name : "hello"
nodes : [
{
name : "constant"
value : "hello"
/*
in code:
ports: {
input: {
init : function() {} // event handler (for pipe reader)
}
output: {
value : function() {} // event handler (for pipe writer)
}
}
*/
},
{
name : "output"
/*
in code:
ports: {
input: {
value : function() {} // event handler (for pipe reader)
}
}
*/
}
],
pipes : {
"ports/input/ports/init" : ["nodes/0/ports/init"],
"nodes/0/ports/output/value" : ["nodes/1/ports/input/value"]
}
ports : {
input : {
init : false // virtual port
}
}
}
/**
So I'm trying to figure out what the difference should be between a one time
performane and a reusable component (composite node below)
**/
// composite node (simplified)
{
name : "composite"
nodes : [
{
name : "constant"
value : "hello"
/*
in code:
ports: {
input: {
init : function() {} // event handler (for pipe reader)
}
output: {
value : function() {} // event handler (for pipe writer)
}
}
*/
},
{
name : "output"
/*
in code:
ports: {
input: {
value : function() {} // event handler (for pipe reader)
}
}
*/
}
],
pipes : {
"ports/input/init" : ["nodes/0/ports/input/init"],
"nodes/0/ports/output/value" : ["nodes/1/ports/input/value"]
}
ports : {
input : {
init : false // virtual port
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment