HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, request–response or request–reply is one of the basic methods
computer A computer is a machine that can be Computer programming, programmed to automatically Execution (computing), carry out sequences of arithmetic or logical operations (''computation''). Modern digital electronic computers can perform generic set ...
s use to communicate with each other in a network, in which the first computer sends a ''request'' for some
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
and the second ''responds'' to the request. More specifically, it is a message exchange pattern in which a requestor sends a request message to a replier system, which receives and processes the request, ultimately returning a message in response. It is analogous to a
telephone call A telephone call, phone call, voice call, or simply a call, is the effective use of a connection over a telephone network between the calling party and the called party. Telephone calls are the form of human communication that was first enabl ...
, in which the caller must wait for the recipient to pick up before anything can be discussed. This is a simple but powerful messaging pattern which allows two applications to have a two-way conversation with one another over a channel; it is especially common in client–server architectures.Hohpe, Gregor. ''Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions''. . p. 184 Request–response pattern can be implemented synchronously (such as web service calls over
HTTP HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
) or asynchronously. In contrast, one-way computer communication, which is like the push-to-talk or "barge in" feature found on some phones and two-way radios, sends a message without waiting for a response. Sending an
email Electronic mail (usually shortened to email; alternatively hyphenated e-mail) is a method of transmitting and receiving Digital media, digital messages using electronics, electronic devices over a computer network. It was conceived in the ...
is an example of one-way communication, and another example are fieldbus sensors, such as most CAN bus sensors, which periodically and autonomously send out their data, whether or not any other devices on the bus are listening for it. (Most of these systems use a "listen before talk" or other contention-based protocol so multiple sensors can transmit periodic updates without any pre-coordination.)


See also

*
Futures and promises In computer science, futures, promises, delays, and deferreds are constructs used for synchronization (computer science), synchronizing program execution (computing), execution in some concurrent programming languages. Each is an object that act ...
* Message exchange pattern * Publish/subscribe *
Remote procedure call In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared computer network), which is written as if it were a ...


References


External links


W3C single-request-response pattern
{{DEFAULTSORT:Request-response Network protocols