What is Megaphone?

What is Megaphone?
The Megaphone project is about enhancing open source chat software. Specifically, the goal is to allow ejabberd to support 1,000,000 simultaneous users. See The Plan page for more details on how I plan to solve this problem. See the About this Blog page for more details on why I created this blog.

Wednesday, December 21, 2011

Time to Hit the Books

Previously

  • I started coding up mod_megaphone.
  • I had some success with trying to send messages around.
  • I created some code to format messages correctly on the ejabberd side.

I think I more or less have identified the entry point into megaphone_http_bind where messages should be sent: that is the process_request function.

And then everything comes to a dead stop.

There is a lot about erlang patterns that I do not know about, and it shows.

For example, I don't understand the following statement:

supervisor:start_child(SupervisorProc, [Sid, Key, IP])


I can parrot the erlang documentation:


Dynamically adds a child specification to the supervisor SupRef which starts the corresponding child process.


But this does not tell me why this approach is being used or what function I can expect to be called in response to this.  At this point, I can continue to blindly grope about, or I can read up on erlang.

For the record, I would prefer to blindly grope around.

I think that in the long run it would be a good idea to familiarize myself with some of the erlang concepts that ejabberd is using, since I will probably run into them again and again.  It just sucks that I have to stop with the coding and hit the books.

So the next step is to read up on what things like supervisor:start_child do.

No comments:

Post a Comment