tiger154 / jwebsocket

Automatically exported from code.google.com/p/jwebsocket
1 stars 0 forks source link

Implement EventManager for ServerSide events #103

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is meant here is a group of events or notifications that are released on 
the server side and that can be usefully exploited.

Example:
EventManager.fire(new ServerEvent("config.loaded", configContainer));
// Simple notification of an event. The listeners can access the object    
          "configContainer"

EventManager.fireUntil (new ServerEvent("config.file_not_found", 
      configContainer));
// The listeners receive the event and can respond. The bubble is 
// over when a listener can solve the problem. In this case, the
// settings can be managed at runtime.

This is really similar to the control of logs, but with the possibility of 
executing code. And create dynamism in the workflow.

EventManager.on("server.connections.63k", ...)
// Turn on balancing mechanisms to prevent overcharging
// Notify the system administrator (email, chat, ...)

EventManager.on("logger.memcached_server_down", ...)
// Use an alternative storage medium
// Notify the system administrator (email, chat, ...)

Filters solve much of the problem, but there are events that occur at runtime 
that need special treatment, including the solution could be out of our system. 
The Observer pattern provides much of the solution. Generally provide clean 
code.

Original issue reported on code.google.com by fivefeetfurther@gmail.com on 28 Oct 2010 at 4:39

GoogleCodeExporter commented 9 years ago

Original comment by fivefeetfurther@gmail.com on 28 Oct 2010 at 4:50

GoogleCodeExporter commented 9 years ago
Discussion about this issue:
http://code.google.com/p/jwebsocket/issues/detail?id=58

Original comment by kyberne...@gmail.com on 1 Nov 2010 at 6:51