5

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?

2 Answers2

3

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.

Reactgular
  • 13,120
  • 4
  • 50
  • 81
1

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.

Craige
  • 3,781