Blackboards

May 04, 2009 18:45

Notes:
  • Blackboard Systems / Blackboard Pattern
  • I bet this is how Wolfram Alpha is implemented
  • Drop-in processors (because they pattern-match tuples in the tuplespace). (Because of this ad-hoc nature, with proper versioning, multiple implementations can run simultenously and GA-like stuff can be applied).
  • "Good enough", like word processing and ( Read more... )

senient_network

Leave a comment

Comments 3

qaexl May 4 2009, 23:48:12 UTC
I think there is a way to implement this with RabbitMQ. However, it may not be incredibly robust.

It requires a separate server that handles the distributed datastore, such as Rinda. The difference is that when it publishes to the agent, it would publish through RabbitMQ.

What makes this brittle is that agents will have to listen to the message queue from RabbitMQ. This can be abstracted ... but the tight coupling will be a source of trouble.

Agent.register(Blackboard)
Blackboard -> sends AMQP queue name (out, take, read) -> Agent
Agent subscribes to AMQP queue

Agent outputs to Blackboard via a queue.publish
Blackboard receives message, updates tuplespace
Matching tuples gets pushed out to the correct Agent

Essentially what I have with the Dataflow library, except more flexible with a distributed tuplespace. I think that solves the problem with the coupling with the JSON marshalling, hm.

-Q

Reply

qaexl May 4 2009, 23:53:25 UTC
class DownloadAgent
include Agent
take [:queried, nil]

def on_query(*args)
# Screen-scrape
s = Scraper.scrape(args)
write [:downloaded, s.id]
end

end

class MapAgent
include Agent
take [:downloaded, nil]

def on_downloaded(*args)
# Map scraped objects
write [:mapped, s.id]
end
end

etc.

Hmm.

-Q

Reply

qaexl May 5 2009, 00:07:34 UTC
Another thought: hack CouchDB so that it watches for certain tuples, and then sends a message whenever something matches.

This can be implemented as a CouchDB plugin. I remember there was a GIS project that works just like that.

-Q

Reply


Leave a comment

Up