Kamaelia docs : Kamaelia.Experimental.Services

Components to help build Services (EXPERIMENTAL)

These components make it easier to build and use public services, registered with the Coordinating Assistant Tracker.

Note: These components are EXPERIMENTAL and are likely to under go substantial change

Register Service

A function that registers specified inboxes on a component as named services with the Coordinating Assistant Tracker (CAT). Returns the component, so can be dropped in where you would ordinarily use a component.

Example Usage:

Create and activate MyComponent instance, registering its "inbox" inbox with the CAT as a service called "MyService":

RegisterService( MyComponent(), {"MyService":"inbox"} ).activate()

How does it work?

This method registers the component you provide with the CAT. It register the inboxes on it that you specify using the names that you specify.

Subscibe To Service

A component that connects to a public service and sends a fixed format message to it requesting to subscribe to a set of 'things' it provides.

Example Usage:

Subscribe to a (fictional) "TV Channels Service", asking for three channels. The tv channel data is then recorded:

pipeline(
    SubscribeTo( "TV Channels Service", ["BBC ONE", "BBC TWO", "ITV"] ),
    RecordChannels(),
    ).run()

The message sent to the "TV Channels Service" will be:

("ADD", ["BBC ONE", "BBC TWO", "ITV"], ( <theSubscribeToComponent>, "inbox" ) )

How does it work?

Describe more detail here

Connect To Service

A component that connects to a public service. Any data you send to its inbox gets sent to the service.

Example Usage

pipeline( MyComponentThatSendMessagesToService(),
        ConnectTo("Name of service"),
        ).run()

How does it work?

Describe in more detail here.


Kamaelia.Experimental.Services.RegisterService

prefab: RegisterService

Kamaelia.Experimental.Services.Subscribe

class Subscribe(Axon.Component.component)

Subscribes to a service, and forwards what it receives to its outbox. Also forwards anything that arrives at its inbox to its outbox.

Unsubscribes when shutdown.

Outboxes

  • outbox :
  • signal : shutdown signalling
  • _toService : request to service

Methods defined here

__init__(self, servicename, *requests)

Subscribe to the specified service, wiring to it, then sending the specified messages. Requests are of the form ("ADD", request, destination)

Kamaelia.Experimental.Services.ToService

Feedback

Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!

Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.

-- Automatic documentation generator, 19 Oct 2008 at 14:29:09 UTC/GMT

This is a page from the Kamaelia website. You can find the original here: