aiocoap.util.asyncio module

Extensions to asyncio and workarounds around its shortcomings

class aiocoap.util.asyncio.PeekQueue(*args, **kwargs)

Bases: object

Queue with a an asynchronous .peek() function.

This is not implemented in terms of inheritance because it would depend on the implementation details of PriorityQueue.put(self, (1, item)) being itself implemented in terms of calling self.put_nowait.

put(item)
put_nowait(item)
peek()
get()
get_nowait()
class aiocoap.util.asyncio.AsyncGenerator

Bases: object

An object implementing the __aiter__ protocol until async def / yield can be used in all supported versions

throw(exception)
ayield(item)
finish()
class aiocoap.util.asyncio.RecvmsgDatagramProtocol

Bases: asyncio.protocols.DatagramProtocol

Inheriting from this indicates that the instance expects to be called back datagram_msg_received instead of datagram_received

class aiocoap.util.asyncio.RecvmsgSelectorDatagramTransport(*args, **kwargs)

Bases: asyncio.selector_events._SelectorDatagramTransport

sendmsg(data, ancdata, flags, address)