summaryrefslogtreecommitdiff
path: root/TAO/examples/Callback_Quoter/README
blob: 783e23b87cdf1d798c4e82311583c150f5f94c02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
******************************************************************************

CALLBACK QUOTER TEST EXAMPLE                           -- Kirthika Parameswaran
                                                          <kirthika@cs.wustl.edu>
******************************************************************************

This is an distributed application which highlights the importance
of the callback feature in helping meet the demands of various clients
without them having to poll continously for input from the server.

There are three parts to the Callback Quoter Example.

1) Supplier
2) Notifier
3) Consumer

  
In detail:
_________
      
1) Supplier
--is the market feed daemon who keeps feeding the current stock
information to the Notifier periodically.
The timer handler has been used in the implementation of the daemon
process. It reads the current stock value from a file and sends it to
the Notifier.

2) Notifier
-- On getting information form the supplier, it checks whether there are
any consumers ineterested in the information and accordingly sends it to
them. The consumer object is registered with the notifier and the data
is pushed to the consumer usoing this refernce.

3) Consumer
-- He is the stock broker interested in the stock values in the market.
He will make decisions of selling only if the stock he is interested in
has a price greater than the threshold value he has set for that stock.
He just registers himself with the Notifier. This saves the time he wastes in
simply polling for information from the Notifier.
This is the callback feature in this example.


Running the application:
________________________

CASE I: USing the Naming Service
================================

a) Non-interactive

  SImply execute the ./run_test.pl, ofcourse after you start off the Naming Service.

b) Interactive

There are 3  parts to it:

1) shell 1: type at the command prompt:

./notifier



2) shell 2: type at the command prompt:

./consumer

register yourself with 'r'
Enter the stockname and value.
Now wait for information to arrive.

You can  unregister by typing 'u' and quit by typing 'q'.



3) shell 3: type at the command prompt:

./supplier -ifilename

The -i option simply tells the daemon where to pick information from.
TIP:: the contents of the input file per line should be: stockname and its price. 
      Sample: ./example.stocks

The other option includes setting the period for the stock feed.

----------------------------------------------------------------------------

CASE II: Without using the Naming Service.
=========================================

There are 3  parts to it:

1) shell 1: type at the command prompt:

./notifier -fior_file -s



2) shell 2: type at the command prompt:

./consumer -fior_file -s

register yourself with 'r'
Enter the stockname and value.
Now wait for information to arrive.

You can  unregister by typing 'u' and quit by typing 'q'.



3) shell 3: type at the command prompt:

./supplier -ifilename -fior_file -s

The -i option simply tells the daemon where to pick information from.
TIP:: the contents of the input file per line should be: stockname and its price. 
      Sample: ./example.stocks

The other option includes setting the period for the stock feed.

-----------------------------------------------------------------------------

Happy troubleshooting!!!