Gamestream Event Handler for PubNub BLOCKS
Pubnub BLOCK creation.
We have two BLOCKs in this application. One handles the stats (Gameplaystats) and the other handles the live score (Gameplaylive).
Step 1 : Login to your Pubnub account with the valid credentials.
Step 2 : Click the "CREATE NEW APP" by giving a name to your APP.
Step 3 : Click on the newly created APP.
You can see the Demo keyset for the new application created.
Step 4 : Click on the Demo keyset and click on the "BLOCKS" (on the left side).
Save the PubNub publish subscribe keys.
Step 5 : Create a new BLOCK by giving the name and description.
Step 6 : Create the Event Handler by clicking "CREATE" button at the bottom.
Step 7 : Give the Name of the Event handler, Channel to communicate with the BLOCK and the option of when BLOCK code should execute(Before Publish or Fire).
Step 8 : Copy the BLOCK code in the text area from here. Update the code to point to your OpenWhisk instance REST API (Refer sub section BLOCK config under main README ) and save it.
Step 9 : Click on the "Start block" button(top right) to start the BLOCK.
Your BLOCK code is now running
Follow the steps below the spawn the Gameplaylive BLOCK
Step 1 : Create another Block by giving the BLOCK name and description.
Step 2 : Create the Event Handler by clicking "CREATE" button at the bottom. Step 3 : Give the Name of the Event handler, Channel to communicate with the "BLOCK" and the option of when block code should execute(Before Publish or Fire).
Your block code is now running.
Note that for this block we use the default BLOCK code that just passes the live score traffic through it. No additional processing is done here.