Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Halfway through the RabbitMQ tutorial, I noticed that the tutorial stops referring to producers "sending" messages and starts using the verb "emit" instead — and pretty consistently, too; after the second tutorial, the verb "send" is no longer used to describe a producer transmitting messages.

Example:

Second Tutorial

The main idea behind Work Queues ... encapsulate a task as a message and send it to the queue. A worker process running in the background ....

Fourth Tutorial

We'll use this model for our logging system. ... Let's focus on emitting logs first.

What is the difference between sending a message vs. emitting one?

share|improve this question
1  
sending has a destination emitting is detected by something else –  ratchet freak May 25 '13 at 22:06

2 Answers 2

up vote 4 down vote accepted

I think in the context of the tutorial he is speaking in terms of broadcaster and listener objects. He is trying to explain that there is a logging object that broadcasts (or emits) messages and that is all it does.

Those messages don't go to a file.

The tutorial continues to explain that a listener has to attach to the logger to receive the messages. You can then attach a listener that does something with what it receives, for example: "writes it to a file."

In this context. The term emit is correct, because he's trying to explain an event system. Events have emitters and receivers.

Previously, I suspect he was using the term send correctly as well. You send things to a queue or place them in the queue. You do not emit or broadcast them into a queue.

A queue is a type of first-in last-out collection.

EDIT:

To clarify. lol

You do not send an event. You send data to the event listener. The event itself is emitted. I prefer the term triggered but that comes from naming event listeners OnSomething.

share|improve this answer

I agree with Ratchet Freak with his definitons:

Sending has a destination emitting is detected by something else

However in this case I think it's just poor word choice by the author, as when writing logs, you do in fact have a destination.

share|improve this answer
    
Logs are sent in the sense that the data is sent to some physical location but Maybe they could be considered as emitted in the sense that they are put out for whoever may read them without knowing exactly who. –  tuespetre May 26 '13 at 0:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.