diff options
author | David Cramer <dcramer@gmail.com> | 2015-10-28 09:55:28 -0700 |
---|---|---|
committer | David Cramer <dcramer@gmail.com> | 2015-10-28 09:55:28 -0700 |
commit | 8490a3e8b9c79b6e27a78585a3f23952d76e8d26 (patch) | |
tree | 67be5e48d2253bd3ae2b4faaf444b01ffa89a244 | |
parent | a93f8201fe08af37d204153bad3dbb20c11ca973 (diff) | |
download | raven-8490a3e8b9c79b6e27a78585a3f23952d76e8d26.tar.gz |
Correct transport docs
-rw-r--r-- | docs/transports.rst | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/docs/transports.rst b/docs/transports.rst index 1db40ad..31f030c 100644 --- a/docs/transports.rst +++ b/docs/transports.rst @@ -3,11 +3,16 @@ Transports A transport is the mechanism in which Raven sends the HTTP request to the Sentry server. By default, Raven uses a threaded asynchronous transport, -but you can easily adjust this by modifying your ``SENTRY_DSN`` value. +but you can easily adjust this by passing your own transport class. -Transport registration is done via the URL prefix, so for example, a -synchronous transport is as simple as prefixing your ``SENTRY_DSN`` with -the ``sync+`` value. + +The transport class is passed via the ``transport`` parameter on ``Client``: + +.. code-block:: python + + from raven import Client + + Client('...', transport=TransportClass) Options are passed to transports via the querystring. @@ -27,24 +32,16 @@ For example, to increase the timeout and to disable SSL verification:: SENTRY_DSN = '___DSN___?timeout=5&verify_ssl=0' -aiohttp -------- - -Should only be used within a :pep:`3156` compatible event loops -(*asyncio* itself and others). - -:: - - SENTRY_DSN = 'aiohttp+___DSN___' - Eventlet -------- Should only be used within an Eventlet IO loop. -:: +.. code-block:: python + + from raven.transport.eventlet import EventletHTTPTransport - SENTRY_DSN = 'eventlet+___DSN___' + Client('...', transport=EventletHTTPTransport) Gevent @@ -52,9 +49,11 @@ Gevent Should only be used within a Gevent IO loop. -:: +.. code-block:: python - SENTRY_DSN = 'gevent+___DSN___' + from raven.transport.gevent import GeventHTTPTransport + + Client('...', transport=GeventHTTPTransport) Requests @@ -62,9 +61,19 @@ Requests Requires the ``requests`` library. Synchronous. -:: +.. code-block:: python + + from raven.transport.requests import RequestsHTTPTransport + + Client('...', transport=RequestsHTTPTransport) + +Alternatively, a threaded client also exists for Requests: + +.. code-block:: python - SENTRY_DSN = 'requests+___DSN___' + from raven.transport.threaded_requests import ThreadedRequestsHTTPTransport + + Client('...', transport=ThreadedRequestsHTTPTransport) Sync @@ -72,9 +81,11 @@ Sync A synchronous blocking transport. -:: +.. code-block:: python + + from raven.transport.http import HTTPTransport - SENTRY_DSN = 'sync+___DSN___' + Client('...', transport=HTTPTransport) Threaded (Default) @@ -82,9 +93,11 @@ Threaded (Default) Spawns an async worker for processing messages. -:: +.. code-block:: python + + from raven.transport.threaded import ThreadedHTTPTransport - SENTRY_DSN = 'threaded+___DSN___' + Client('...', transport=ThreadedHTTPTransport) Tornado @@ -92,9 +105,11 @@ Tornado Should only be used within a Tornado IO loop. -:: +.. code-block:: python - SENTRY_DSN = 'tornado+___DSN___' + from raven.transport.tornado import TornadoHTTPTransport + + Client('...', transport=TornadoHTTPTransport) Twisted @@ -102,6 +117,8 @@ Twisted Should only be used within a Twisted event loop. -:: +.. code-block:: twisted + + from raven.transport.twisted import TwistedHTTPTransport - SENTRY_DSN = 'twisted+___DSN___' + Client('...', transport=TwistedHTTPTransport) |