In my previous two posts I discussed some basics of getting started with development of Google Wave robots using .Net and then talked about publishing of capabilities.
Let's now see what all events get fired by google wave client and how do you handle them in your robot. First let's see what all events (or capabilities) are available. Here is some information from Google wave api site itself.
The following events which a robot may subscribe to are particularly important:
I will discuss these events in little bit more details and try to tell you when they get fired
This event is fired as soon as you add the robot as one of the participant in your wave. It is not manadatory that a robot has to be added when a wave is started. As I mentioned few times, a robot is like a real participant in wave that can be added or removed at any given time. So this event is fired when robot gets added to wave. To handle this event, you will need to override OnWaveletSelfAdded method in your ASHX handler.
As soon as robot gets added to a wave, framework sends this event to robot with list of participants who are already part of the wave. Your robot will be included as one of the participants in that list.
This event is fired when a new blip is created in the wave. An example of creating a new blip could be when you reply to another message. Moment you hit reply link or button, this event is fired. This will be good place to any state initialization in your robot for all new blips that are created. For example if you want to cache ID of the blip for later tracking or things like that, you can do that in this event handler.
This event is fired when there is any change in the document. This includes character by character change notification being sent to the robot or participants. You will notice that as you are typing in your wave, your robot is getting these notifications continuously. Since this event is fired very often, it is going to create a lot of network traffic for your robot as well as web server handling the requests. There are couple of things you may want to keep in mind when subscribing to this event:
This event is fired when a blip is submitted. What this means is that when you hit Done button for your blip, it is no longer in draft mode and it gets submitted. This is one of the most used events because at this point the content of the blip is final (till somebody edits it again). If you are taking action based on final content of the blip, this will be the place where you will do it.
As name suggests, this is fired when a blip is deleted from wave. If you are keeping some state for a blip in your robot, this will be a good place to perform any clean up or any final actions that need to be taken on that blip.
There are lot more events that your subscribe to. But the ones that discussed are very basic building blocks of a simple robots. I will discuss other events in my later posts. In next post I will walk through development of a simple debugging robot.
Life cycle events of a goole wave robot
How to plan CCSP Exam preparation
Develop a MongoDB pipeline to transform data into time buckets
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2025 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use