blob: 6ede4153e6c3377e876b13e96bb080b361b5b750 [file] [log] [blame]
E. Scott Daniels3a2533f2020-04-22 12:40:27 -04001.if false
2==================================================================================
3 Copyright (c) 2020 Nokia
4 Copyright (c) 2020 AT&T Intellectual Property.
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18.fi
19
20&h2(Callback Receiver)
21This sample programme implements a simple message listener which
22registers three callback functions to process two specific
23message types and a default callback to handle unrecognised messages.
24
25&space
26When a message of type 1 is received, it will send two response messages
27back to the sender.
28Two messages are sent in order to illustrate that it is possible to
29send multiple responses using the same received message.
30
31&space
32The programme illustrates how multiple listening threads can be
33used, but the programme is &bold(not) thread safe; to keep
34this example as simple as possible, the counters
35are not locked when incremented.
36
E. Scott Danielsef362052020-07-22 15:49:54 -040037&h2(Metrics Generation)
38The example also illustrates how a metrics object instance can be created
39and used to send appliction metrics to the collector.
40In this example the primary callback function will genereate metrics with
41the receipt of each 1000th message.
42
E. Scott Daniels3a2533f2020-04-22 12:40:27 -040043&space
44&indent
45.** pull in the code from the example directory
46&ex_start
47.im j=start-example ../../../examples/xapp_t1.cpp
48&ex_end
E. Scott Danielsd486a172020-07-29 12:39:54 -040049&fig_cen( Simple callback application. )
E. Scott Daniels3a2533f2020-04-22 12:40:27 -040050&uindent
51&space