Skip to content

Commit

Permalink
docs: update v2 migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Oct 28, 2024
1 parent 174c9a5 commit 9b7d50d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/source/howto/migrate-to-v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,22 @@ If you need to access the underlying protocol object this is now via the ``proto

pygls' base server class has been renamed

Removed ``loop`` argument from ``pygls.server.JsonRPCServer``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Servers and clients in pygls v2 now both use the high level asyncio API, removing the need for an explicit ``loop`` argument to be passed in.
If you need control over the event loop used by pygls you can use functions like :external:py:function:`asyncio.set_event_loop` before starting the server/client.

Removed ``multiprocessing.pool.ThreadPool``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :external:py:class:`multiprocessing.pool.ThreadPool` instance has been removed, *pygls* now makes use of :external:py:class:`concurrent.futures.ThreadPoolExecutor` for all threaded tasks.

The ``thread_pool_executor`` attribute of the base ``JsonRPCServer`` class has been removed, the ``ThreadPoolExecutor`` can be accessed via the ``thread_pool`` attribute instead.

New ``pygls.io_`` module
^^^^^^^^^^^^^^^^^^^^^^^^

There is a new ``pygls.io_`` module containing main message parsing loop code common to both client and server

- The equivlaent to pygls v1's ``pygls.server.aio_readline`` function is now ``pygls.io_.run_async``

0 comments on commit 9b7d50d

Please sign in to comment.