6 Interlude 2 If you've come this far, you may be wondering the worth of what you've acheived. Essentially you've managed to implement the core of a working Axon system, specifically on the most used aspects of the system. Sure, there is some syntactic sugar relating to creation and managing of links, but that's what it is - sugar. One of the longer examples on the Kamaelia website, specifically in the blog area, is how to build new components. That's probably the next logical place to start looking. However, taking one of the components on that page, we find that the core implementation of them matches the same core API as the component system you've implemented. For example, let's take a look at the multicast sender. class Multicast_sender(component): This has an initialiser for grabbing some initial values, and ensuring the super class's initialiser is called: def __init__(self, local_addr, local_port, remote_addr, remote_port): The main function/generator then is relatively simple - set up the socket, wait for data and send it out: def main(self): From this, it should be clear that this will work inside the mini-axon system you've created. Similarly, we can create a simple file reading component thus: class FileReader(component): This can then also be used using the component system you've just created to build a simplistic system for sending data to a multicast group: reader = FileReader("fortune.txt") That can then be activated and run in the usual way: myscheduler = scheduler() |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.