| 1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
| 2 |
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 3 |
|
| 4 |
<chapter id="backend-compiled"> |
| 5 |
<title>Compiled Backends</title> |
| 6 |
<para> |
| 7 |
If you have a C or C++ binding for your package system then |
| 8 |
you can use a compiled backend, which is more efficient than |
| 9 |
using helpers as described below. |
| 10 |
You can include the headers in the backend (with extra |
| 11 |
libraries) and then just write the simple code to interface |
| 12 |
with the methods of PackageKit. |
| 13 |
A C example can be found in <literal>backends/box</literal> and a |
| 14 |
C++ example in <literal>backends/apt</literal>. |
| 15 |
</para> |
| 16 |
<para> |
| 17 |
You will have to use threading if your backend does not support async |
| 18 |
operation as requests have to return immediately. |
| 19 |
This is very important. Do any significant processing in a thread, and |
| 20 |
certainly don't return package results without creating a thread. |
| 21 |
By keeping the backends async we can make sure that there is no blocking |
| 22 |
which means the command line and UI do not freeze. |
| 23 |
</para> |
| 24 |
</chapter> |