Skip to content
Snippets Groups Projects
Unverified Commit 235914c6 authored by J. Nick Koston's avatar J. Nick Koston Committed by GitHub
Browse files

Improve performance of dhcp integration client processing (#106137)

We were using run_callback_threadsafe here which has the overhead
of creating a future and waiting for the result when we throw
it away.
parent 1d63c348
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,6 @@ from homeassistant.helpers.event import (
)
from homeassistant.helpers.typing import ConfigType, EventType
from homeassistant.loader import DHCPMatcher, async_get_dhcp
from homeassistant.util.async_ import run_callback_threadsafe
from .const import DOMAIN
......@@ -145,13 +144,9 @@ class WatcherBase(ABC):
def process_client(self, ip_address: str, hostname: str, mac_address: str) -> None:
"""Process a client."""
return run_callback_threadsafe(
self.hass.loop,
self.async_process_client,
ip_address,
hostname,
mac_address,
).result()
self.hass.loop.call_soon_threadsafe(
self.async_process_client, ip_address, hostname, mac_address
)
@callback
def async_process_client(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment