git ssb

0+

wanderer🌟 / js-primea-abstract-container



Commit 3c51a3dbfcb5e55cfdcd0b54850b584f04b0f602

Merge pull request #2 from primea/new-api

New API (onCreation/onMessage/onStartup)
wanderer authored on 7/27/2017, 10:17:58 PM
GitHub committed on 7/27/2017, 10:17:58 PM
Parent: abe94d07955c811f1fdb8e283515c3ec0309a104
Parent: 5f1ef8b77f428cd3ebef37c487314c5ef52acff2

Files changed

index.jschanged
index.jsView
@@ -10,16 +10,23 @@
1010 // In general, a root instance receives no message, but every other instance
1111 // receives a message with a singel port, which is a channel to its parent (aka the root).
1212 //
1313 // Optionally it can return a single value.
14- async initialize (message) {
14 + async onCreation (message) {
1515 throw new Error('Unimplemented initialiser')
1616 }
1717
18 + // This method runs when the container needs to be started up. It cannot be
19 + // called before onCreation was successful. It can be called after a shutdown
20 + // was requested in onIdle.
21 + async onStartup () {
22 + throw new Error('Unimplemented startup method')
23 + }
24 +
1825 // This is called for each incoming message the container gets.
1926 //
2027 // Optionally it can return a single value.
21- async run (message) {
28 + async onMessage (message) {
2229 throw new Error('Unimplemented message: ' + message.data)
2330 }
2431
2532 // onIdle is called when there are no more immediate messages pending

Built with git-ssb-web