Add support for config file parsing and watching
[ric-plt/xapp-frame-cpp.git] / doc / src / user / example2.im
1 .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)
21 This sample programme implements a simple message listener which
22 registers three callback functions to process two specific
23 message types and a default callback to handle unrecognised messages.
24
25 &space
26 When a message of type 1 is received, it will send two response messages
27 back to the sender.
28 Two messages are sent in order to illustrate that it is possible to
29 send multiple responses using the same received message.
30
31 &space
32 The programme illustrates how multiple listening threads can be
33 used, but the programme is &bold(not) thread safe; to keep
34 this example as simple as possible, the counters
35 are not locked when incremented.
36
37 &h2(Metrics Generation)
38 The example also illustrates how a metrics object instance can be created
39 and used to send appliction metrics to the collector.
40 In this example the primary callback function will genereate metrics with
41 the receipt of each 1000th message.
42
43 &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
49 &fig_cen( Simple callback application. )
50 &uindent
51 &space