# pymodbus.client.asynchronous package

## Async Modbus Client implementation based on Twisted, tornado and asyncio

Example run:

    from pymodbus.client.asynchronous import schedulers

    # Import The clients

    from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as Client
    from pymodbus.client.asynchronous.serial import AsyncModbusSerialClient as Client
    from pymodbus.client.asynchronous.udp import AsyncModbusUDPClient as Client

    # For tornado based asynchronous client use
    event_loop, future = Client(schedulers.IO_LOOP, port=5020)

    # For twisted based asynchronous client use
    event_loop, future = Client(schedulers.REACTOR, port=5020)

    # For asyncio based asynchronous client use
    event_loop, client = Client(schedulers.ASYNC_IO, port=5020)

    # Here event_loop is a thread which would control the backend and future is
    # a Future/deffered object which would be used to
    # add call backs to run asynchronously.

    # The Actual client could be accessed with future.result() with Tornado
    # and future.result when using twisted

    # For asyncio the actual client is returned and event loop is asyncio loop

## Subpackages

- pymodbus.client.asynchronous.asyncio package
- pymodbus.client.asynchronous.factory package
  - Submodules
  - pymodbus.client.asynchronous.factory.serial module
  - pymodbus.client.asynchronous.factory.tcp module
  - pymodbus.client.asynchronous.factory.udp module
- pymodbus.client.asynchronous.schedulers package
- pymodbus.client.asynchronous.tornado package
- pymodbus.client.asynchronous.twisted package
  - Implementation of a Modbus Client Using Twisted

## Submodules

## pymodbus.client.asynchronous.serial module

class `pymodbus.client.asynchronous.serial.``AsyncModbusSerialClient`

  Bases: `object`

  Actual Async Serial Client to be used.

  To use do:

      from pymodbus.client.asynchronous.serial import AsyncModbusSerialClient

## pymodbus.client.asynchronous.tcp module

class `pymodbus.client.asynchronous.tcp.``AsyncModbusTCPClient`

  Bases: `object`

  Actual Async Serial Client to be used.

  To use do:

      from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient

## pymodbus.client.asynchronous.thread module

class `pymodbus.client.asynchronous.thread.``EventLoopThread`(name, start, stop, *args, **kwargs)

  Bases: `object`

  Event loop controlling the backend event loops (io_loop for tornado, reactor for twisted and event_loop for Asyncio)

  `start`()

    Starts the backend event loop :return:

  `stop`()

    Stops the backend event loop :return:

## pymodbus.client.asynchronous.udp module

class `pymodbus.client.asynchronous.udp.``AsyncModbusUDPClient`

  Bases: `object`

  Actual Async UDP Client to be used.

  To use do:

      from pymodbus.client.asynchronous.tcp import AsyncModbusUDPClient