Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Applied Java™ Patterns - Stephen Stelting, Olav Maassen.pdf
Скачиваний:
202
Добавлен:
24.05.2014
Размер:
2.84 Mб
Скачать

Client pull is best suited to situations where some or all of the following are true:

The amount of information to transfer is small

Application data is in constant flux

Information update does not have to be instantaneous

Examples of client pull are common on the Web. Stock tickers, sports tickers, and news tickers (pretty much anything with a ticker) are often managed using client pull. Applications that allow users to examine resources that are updated over time, such as browsing a remote directory structure, offer another possible use for client pull.

Anyone who has gone on an automobile trip with children has seen a direct example of client pull technology. The clients (ages 3-12) periodically poll the servers for status updates. Client queries usually take the form of “Are we there yet?” or “Can we stop? I want a drink.” Requests generally occur with a polling rate between 30 seconds and a minute.

Server Push

Solutions using server push require the server process to send change notifications to all interested clients. This permits timely notification when changes have occurred in system data.

A Successive Update sequence diagram for server push is shown in Figure 4.9.

Figure 4.9. Successive Update sequence diagram (server push)

168