• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-Dec-2021-

MakefileH A D03-Dec-2021639 4131

READMEH A D03-Dec-20212.2 KiB7450

print_r.luaH A D03-Dec-20211.3 KiB6961

ps_lua.cH A D03-Dec-202112.1 KiB510406

ps_lua.luaH A D03-Dec-2021730 2017

ps_python.cH A D03-Dec-202115.4 KiB692576

ps_python.pyH A D03-Dec-2021826 2319

spoa-server.confH A D03-Dec-2021978 3430

spoa-server.spoe.confH A D03-Dec-2021310 1411

spoa.cH A D03-Dec-202131.3 KiB1,3171,006

spoa.hH A D03-Dec-20214.8 KiB165131

README

1Multi script langyage Stream Processing Offload Agent
2-----------------------------------------------------
3
4This agent receive SPOP message and process it with script languages. The
5language register callback with a message. Each callback receive the list
6of arguments with types according with the language capabilities. The
7callback write variables which are sent as response when the processing
8is done.
9
10
11  Compilation
12---------------
13
14The server currently supports Lua and Python. Type "make" with the options:
15USE_LUA=1 and/or USE_PYTHON=1.
16
17
18  Start the service
19---------------------
20
21After you have compiled it, to start the service, you just need to use "spoa"
22binary:
23
24    $> ./spoa  -h
25    Usage: ./spoa [-h] [-d] [-p <port>] [-n <num-workers>]
26        -h                  Print this message
27        -d                  Enable the debug mode
28        -p <port>           Specify the port to listen on (default: 12345)
29        -n <num-workers>    Specify the number of workers (default: 5)
30        -f <file>           Load script according with the supported languages
31
32The file processor is recognized using the extension. .lua or .luac for lua and
33.py for python. Start example:
34
35    $> ./spoa -d -f ps_lua.lua
36
37	 $> ./spoa -d -f ps_python.py
38
39
40  Configure
41-------------
42
43Sample configuration are join to this server:
44
45  spoa-server.conf      : The HAProxy configuration file using SPOE server
46  spoa-server.spoe.conf : The SPOP description file used by HAProxy
47  ps_lua.lua            : Processing Lua example
48  ps_python.py          : Processing Python example
49
50
51  Considerations
52------------------
53
54This server is a beta version. It works fine, but some improvement will be
55welcome:
56
57Main process:
58
59 * Improve log management: Today the log are sent on stdout.
60 * Improve process management: The dead process are ignored.
61 * Implement systemd integration.
62 * Implement threads: It would be fine to implement thread working. Shared
63   memory is welcome for managing database connection pool and something like
64   that.
65 * Add PHP support and some other languages.
66
67Python:
68
69 * Improve reporting: Catch python error message and report it in the right
70   place. Today the error are dumped on stdout. How using syslog for logging
71   stack traces ?
72
73Maybe some other things...
74