1 ******************************************************************************
2 CALLBACK QUOTER TEST EXAMPLE -- Kirthika Parameswaran
3 <kirthika@cs.wustl.edu>
4 ******************************************************************************
6 This is an distributed application which highlights the importance
7 of the callback feature in helping meet the demands of various clients
8 without them having to poll continuously for input from the server.
10 There are three parts to the Callback Quoter Example.
20 --is the market feed daemon who keeps feeding the current stock
21 information to the Notifier periodically.
22 The timer handler has been used in the implementation of the daemon
23 process. It reads the current stock value from a file and sends it to
27 -- On getting information form the supplier, it checks whether there are
28 any consumers interested in the information and accordingly sends it to
29 them. The consumer object is registered with the notifier and the data
30 is pushed to the consumer using this reference.
33 -- He is the stock broker interested in the stock values in the market.
34 He will make decisions of selling only if the stock he is interested in
35 has a price greater than the threshold value he has set for that stock.
36 He just registers himself with the Notifier. This saves the time he wastes in
37 simply polling for information from the Notifier.
38 This is the callback feature in this example.
41 Running the application:
42 ________________________
44 CASE I: USing the Naming Service
45 ================================
49 SImply execute the ./run_test.pl, ofcourse after you start off the Naming Service.
53 There are 3 parts to it:
55 1) shell 1: type at the command prompt:
59 2) shell 2: type at the command prompt:
63 register yourself with 'r'
64 Enter the stockname and value.
65 Now wait for information to arrive.
67 You can unregister by typing 'u' and quit by typing 'q'.
69 3) shell 3: type at the command prompt:
73 The -i option simply tells the daemon where to pick information from.
74 TIP:: the contents of the input file per line should be: stockname and its price.
75 Sample: ./example.stocks
77 The other option includes setting the period for the stock feed.
79 ----------------------------------------------------------------------------
81 CASE II: Without using the Naming Service.
82 =========================================
84 There are 3 parts to it:
86 1) shell 1: type at the command prompt:
88 ./notifier -fior_file -s
90 2) shell 2: type at the command prompt:
92 ./consumer -fior_file -s
94 register yourself with 'r'
95 Enter the stockname and value.
96 Now wait for information to arrive.
98 You can unregister by typing 'u' and quit by typing 'q'.
100 3) shell 3: type at the command prompt:
102 ./supplier -ifilename -fior_file -s
104 The -i option simply tells the daemon where to pick information from.
105 TIP:: the contents of the input file per line should be: stockname and its price.
106 Sample: ./example.stocks
108 The other option includes setting the period for the stock feed.
110 -----------------------------------------------------------------------------
112 Happy troubleshooting!!!