[MUD-Dev] OpenMUD: bus-based communications

James Wilson jwilson at rochester.rr.com
Sat Oct 24 21:51:28 CEST 1998


On Sat, 24 Oct 1998, Niklas Elmqvist wrote:

> - Inter-module communication is carried out using a decoupled mechanism
>(cf Gamora Buses). IOW, modules do *not* know of each other at the
>beginning, but broadcasts their presence on a server-wide channel.
>Interested modules may create pipes or channels to the new module and use
>this for message passing. Pipes may be implemented in terms of a C++
>class (neatest), function pointers (most efficient), or network sockets
>(for distributed systems). Possibly, all three could be supported.

there are two ways I can see to interpret the above:

1. modules have various options for communicating with each other,
which they have to negotiate. ("can you give me function pointers? oh. 
well, how about RPC?")
2. there is an abstract "send message to module" mechanism, which 
all modules use without knowing what it really does. This mechanism 
could be implemented in various ways.

> - Messages passed between modules are serialized according to a
>specification provided by the receiving module. That is, the magic module
>might say: "I first want a byte containing the spell code, then an int for
>the level of the caster, then a DB index for the target and caster." The
>parser module would follow this format when passing messages to the magic
>module. 

so everything would be serialized to bytes? or would this only be 
necessary in a distributed system? why should a system that runs on a 
single machine take the performance hit to serialize data it could simply
pass in as parameters? 

I am having trouble seeing the point of this system. If Module A needs
to use functionality which resides in Module B, you don't need to
resort to a bus. Module B can export some symbols, which A can then
grab and use very happily (with direct method/function calls). If 
Module B really resides on some other machine, there's still no need 
for a bus: the process containing A can be supplied with a proxy, B', 
which pretends to be B but really marshals the calls and sends them over 
the network CORBA-style. Perhaps there's also a bit of reflection, so 
A can tell the difference and optimize the way it uses B or B'.

James




More information about the mud-dev-archive mailing list