Message Queues
Review, Research, and Discussion
- What does it mean that web sockets are bidirectional? Why is this useful?
- to meet the demands of pervasive data-centric applications and services.
- Does socket.io use HTTP? Why?
-
Yes,when websockets aren’t supported.
- What happens when a client emits an event?
- When a client emits, it sends the data and the server will receive it when the client connect
- What happens when a server emits an event?
- It will sends the data.
Vocabulary Terms
Socket :
- when twoprograms running it is the endpoint of this communication link.
Web Socket :
- computer communications protocol between a client and a server.
Socket.io :
- JavaScript library for realtime web applications.
Client :
- a computer that connects to the network.
Server :
- who receive and process the requests from the client.
OSI Model :
- Open Systems Interconnection Model is a conceptual framework used to describe the functions of a networking system.
TCP Model :
- It stands for Transmission Control Protocol/Internet Protocol. The TCP/IP model is a concise version of the OSI model.
TCP :
- Transmission Control Protocol.
UDP :
- User Datagram Protocol.
Message Queue?
-
A message queue is a form of asynchronous service-to-service communication used in serverless and microservices architectures.
-
Messages are stored on the queue until they are processed and deleted.
-
Each message is processed only once, by a single consumer.
-
Message queues can be used to decouple heavyweight processing, to buffer or batch work, and to smooth spiky workloads.
Rooms and Namespaces:
- A room is an arbitrary channel that sockets can join and leave. It can be used to broadcast events to a subset of clients.
- rooms are a server-only concept.
- Each Socket in Socket.IO is identified by a random, unguessable, unique identifier
Socket#id
.
-
by providing a standardized way for the server to send content to the client without being first requested by the client.
-
allowing messages to be passed back and forth while keeping the connection open.
-
a two-way ongoing conversation can take place between the client and the server.
- Socket.IO is a library that enables real-time and full-duplex communication between the Client and the Web servers.
- It uses the WebSocket protocol to provide the interface, it is divided into two parts;
both WebSocket
vsSocket.io
are event-driven libraries.