Skip to content

Event API #25

Open
Open

Description

@ProjectMoon

Jython has the ability to turn Java event handling into Pythonic event-handling constructs. If you have an event-handling interface that extends EventListener, and then provide an addListener method to a given object, Jython will automagically convert the event listener's methods to properties of the object that take a Python function as a parameter.

This technology should be leveraged for the event-handling framework if at all possible. It is more intuitive than the "query language" idea that is currently kicking around in the RingMUD code.

Activity

  1. ProjectMoon commented on Jun 9, 2010

    @ProjectMoon
    OwnerAuthor

    Possible idea: Objects can subscribe to events about themselves or objects contained within themselves via the standard add*Listener method pattern. Each object that will respond to events will have a corresponding listener interface with specialized methods dealing with events relevant to that object. An object would not be able to subscribe to events about another object.

    The question is: Where does this leave things like the Senses API?

  2. ProjectMoon commented on Jun 9, 2010

    @ProjectMoon
    OwnerAuthor

    Re: Senses API--

    Keep Senses API separate, as its own "event handling framework," much like how ticker listening is its own "event handling framework." These object events will fall under their own API category called something like "Reflective Event API" or something else fancy-sounding.

  3. ProjectMoon commented on Jul 3, 2010

    @ProjectMoon
    OwnerAuthor

    New event API is almost done. Have created Object Index System, and the ability to add events to loaded objects. Have not added the ability for "live" events yet. Also need to integrate Java's observer API to allow objects to subscribe to other objects' events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions