Skip to content

Commit

Permalink
Rename Event to Message.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsamarin committed Mar 30, 2012
1 parent d568eed commit d43b666
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
14 changes: 0 additions & 14 deletions hub/Event.js

This file was deleted.

2 changes: 1 addition & 1 deletion hub/Hub.js
Expand Up @@ -62,7 +62,7 @@ Hub.prototype.shutdown = function () {
// Tell each petal to shut down
var num = this.petal.length;
this.petal.forEach (function (each) {
each.disconnect (function() {
each.shutdown (function() {
num--;
if (!num) {
exit();
Expand Down
7 changes: 7 additions & 0 deletions hub/HubConfig.js
Expand Up @@ -4,6 +4,13 @@ var fs = require ("fs");
var path = require ("path");
var FileUtils = require ("./FileUtils.js");

/**
* HubConfig:
* This is actually an internal petal which creates
* a special lic/config item. This item can be used by all
* petals to access, update, and modify global configuration.
**/

var HubConfig = function (locations) {

this.path = null;
Expand Down
3 changes: 2 additions & 1 deletion hub/ItemManager.js
@@ -1,3 +1,4 @@
var util = require ("util");

/* ItemManager:
* This object is the main router for all of lic's events.
Expand All @@ -9,5 +10,5 @@ var ItemManager = module.exports = function () {
};

ItemManager.prototype.send = function(event) {
console.log (event.stringify ());
util.puts (util.inspect (event, false, 2, true));
};
2 changes: 2 additions & 0 deletions hub/Petal.js
Expand Up @@ -2,6 +2,8 @@ var Petal = function(item_manager) {
this.item_manager = item_manager;
};

Petal.prototype.item_manager = null;

/** Petal#shutdown:
* This function is called by the hub when it is requested
* to shutdown. The hub will terminate once the callback is called.
Expand Down
4 changes: 2 additions & 2 deletions petal/irc/Connection.js
Expand Up @@ -2,7 +2,7 @@ var util = require ("util");
var net = require ("net");
var tls = require ("tls");

var Event = require ("../Event.js");
var Message = require ("../../hub/Message.js");

/*
* A special connection for handling the IRC protocol.
Expand Down Expand Up @@ -92,7 +92,7 @@ var IRCConnection = function (profile, item_manager) {
data = this.parse_message (message);
if (data) {
this.emit (data.command, data);
this.item_manager.send (new Event(this.get_item_name (data), data.command, data));
this.item_manager.send (new Message(this.get_item_name (data), data.command, data));
}
}).bind (this));

Expand Down

0 comments on commit d43b666

Please sign in to comment.