Debian Codegraph @

doc/source/asyncio/guide/deprecation.rst

raw
1 .. _manage-your-deprecations:
2
3 Manage Your Deprecations
4 ========================
5
6 Libraries or applications may have specific features who are strongly related
7 to Eventlet, like the ``heartbeat_in_pthread`` feature in
8 the Opentack `oslo.messaging
9 <https://docs.openstack.org/oslo.messaging/latest/configuration/opts.html#oslo_messaging_rabbit.heartbeat_in_pthread>`_
10 deliverable.
11
12 Migrating off of Eventlet would make these features obsolete. As this kind of
13 feature expose configuration endpoints people would have to deprecate them to
14 allow your users to update their config files accordingly. However, the
15 deprecation process would take several months or even numerous versions before
16 hoping to see these features removed. Hence blocking the migration.
17
18 The proposed solution is to mock these features with empty entrypoints
19 who will only raise deprecation warnings to inform your users that they have
20 to update their config files. After 1 or 2 new versions these empty mocks
21 could be safely removed without impacting anybody.
22
23 In other words, these feature will remain in the code, but they will do
24 nothing. They will be empty feature allowing us to migrate properly.
25
26 Example with the ``heartbeat_in_pthread`` feature, by using Asyncio
27 we wouldn't have to run heartbeats in a separated threads. This feature,
28 the RabbitMQ heartbeat, would be run in a coroutine. A coroutine who is
29 ran in the main native thread. The config option will remain available but
30 it will only show a deprecation warning like the following one::
31
32 __main__:1: DeprecationWarning: Using heartbeat_in_pthread is
33 deprecated and will be removed in {SERIES}. Enabling that feature
34 have no functional effects due to recent changes applied in the
35 networking model used by oslo.messaging. Please plan an update of your
36 configuration.