Skip to content

Instantly share code, notes, and snippets.

@aninhumer
Created January 13, 2010 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aninhumer/276617 to your computer and use it in GitHub Desktop.
Save aninhumer/276617 to your computer and use it in GitHub Desktop.
.sub 'main' :main
.local pmc init_eh, eh_sub
init_eh = new ['Hash']
init_eh['type'] = 'testevent'
eh_sub = get_global 'testcaller'
init_eh['code'] = eh_sub
.local pmc handler
handler = new ['EventHandler'], init_eh
addhandler handler
.local pmc init_event, event_sub
init_event = new ['Hash']
event_sub = get_global 'hello'
init_event['code'] = event_sub
init_event['type'] = 'event'
init_event['subtype'] = 'testevent'
.local pmc event
event = new ['Task'], init_event
schedule event
.end
.sub 'hello'
say 'Hello, world!'
.end
.sub 'testcaller'
.param pmc handler
.param pmc event
$P0 = getattribute event, 'code'
$P0()
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment