3 ******************************************************************************
4 CALLBACK QUOTER TEST EXAMPLE -- Kirthika Parameswaran
5 <kirthika@cs.wustl.edu>
6 ******************************************************************************
8 This is an distributed application which highlights the importance
9 of the callback feature in helping meet the demands of various clients
10 without them having to poll continuously for input from the server.
12 There are three parts to the Callback Quoter Example.
23 --is the market feed daemon who keeps feeding the current stock
24 information to the Notifier periodically.
25 The timer handler has been used in the implementation of the daemon
26 process. It reads the current stock value from a file and sends it to
30 -- On getting information form the supplier, it checks whether there are
31 any consumers interested in the information and accordingly sends it to
32 them. The consumer object is registered with the notifier and the data
33 is pushed to the consumer using this reference.
36 -- He is the stock broker interested in the stock values in the market.
37 He will make decisions of selling only if the stock he is interested in
38 has a price greater than the threshold value he has set for that stock.
39 He just registers himself with the Notifier. This saves the time he wastes in
40 simply polling for information from the Notifier.
41 This is the callback feature in this example.
44 Running the application:
45 ________________________
47 CASE I: USing the Naming Service
48 ================================
52 SImply execute the ./run_test.pl, ofcourse after you start off the Naming Service.
56 There are 3 parts to it:
58 1) shell 1: type at the command prompt:
64 2) shell 2: type at the command prompt:
68 register yourself with 'r'
69 Enter the stockname and value.
70 Now wait for information to arrive.
72 You can unregister by typing 'u' and quit by typing 'q'.
76 3) shell 3: type at the command prompt:
80 The -i option simply tells the daemon where to pick information from.
81 TIP:: the contents of the input file per line should be: stockname and its price.
82 Sample: ./example.stocks
84 The other option includes setting the period for the stock feed.
86 ----------------------------------------------------------------------------
88 CASE II: Without using the Naming Service.
89 =========================================
91 There are 3 parts to it:
93 1) shell 1: type at the command prompt:
95 ./notifier -fior_file -s
99 2) shell 2: type at the command prompt:
101 ./consumer -fior_file -s
103 register yourself with 'r'
104 Enter the stockname and value.
105 Now wait for information to arrive.
107 You can unregister by typing 'u' and quit by typing 'q'.
111 3) shell 3: type at the command prompt:
113 ./supplier -ifilename -fior_file -s
115 The -i option simply tells the daemon where to pick information from.
116 TIP:: the contents of the input file per line should be: stockname and its price.
117 Sample: ./example.stocks
119 The other option includes setting the period for the stock feed.
121 -----------------------------------------------------------------------------
123 Happy troubleshooting!!!