File: unix_socket.rst

package info (click to toggle)
python-statsd 4.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 240 kB
  • sloc: python: 912; makefile: 127
file content (20 lines) | stat: -rw-r--r-- 653 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.. _unix-socket-chapter:

=====================
UnixSocketStatsClient
=====================

.. code-block:: python

    statsd = UnixSocketStatsClient(socket_path='/var/run/stats.sock')

The :py:class:`UnixSocketStatsClient` class has a very similar interface to
:py:class:`TCPStatsClient`, but internally it uses Unix Domain sockets instead
of TCP.  These are the main differences when using ``UnixSocketStatsClient``
compared to ``StatsClient``:

* The ``socket_path`` parameter is required. It has no default.

* The ``host``, ``port`` and ``ipv6`` parameters are not allowed.

* The application process must have permission to write to the socket.