1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

switch from deferred calls to 'run this now' tasks

This commit is contained in:
Joel Bender 2017-09-19 02:43:12 -04:00
parent 8b1cccdbfb
commit 56b5cd7c52
3 changed files with 9 additions and 9 deletions

View File

@ -12,9 +12,9 @@ from copy import deepcopy
from .errors import ConfigurationError
from .debugging import ModuleLogger, bacpypes_debugging
from .core import deferred
from .pdu import Address
from .comm import Client, Server, bind
from .task import OneShotFunction
# some debugging
_debug = 0
@ -129,8 +129,8 @@ class Node(Server):
elif (not self.spoofing) and (pdu.pduSource != self.address):
raise RuntimeError("spoofing address conflict")
# actual network delivery is deferred
deferred(self.lan.process_pdu, pdu)
# actual network delivery is a zero-delay task
OneShotFunction(self.lan.process_pdu, pdu)
def __repr__(self):
return "<%s(%s) at %s>" % (

View File

@ -12,9 +12,9 @@ from copy import deepcopy
from .errors import ConfigurationError
from .debugging import ModuleLogger, bacpypes_debugging
from .core import deferred
from .pdu import Address
from .comm import Client, Server, bind
from .task import OneShotFunction
# some debugging
_debug = 0
@ -129,8 +129,8 @@ class Node(Server):
elif (not self.spoofing) and (pdu.pduSource != self.address):
raise RuntimeError("spoofing address conflict")
# actual network delivery is deferred
deferred(self.lan.process_pdu, pdu)
# actual network delivery is a zero-delay task
OneShotFunction(self.lan.process_pdu, pdu)
def __repr__(self):
return "<%s(%s) at %s>" % (

View File

@ -12,9 +12,9 @@ from copy import deepcopy
from .errors import ConfigurationError
from .debugging import ModuleLogger, bacpypes_debugging
from .core import deferred
from .pdu import Address
from .comm import Client, Server, bind
from .task import OneShotFunction
# some debugging
_debug = 0
@ -129,8 +129,8 @@ class Node(Server):
elif (not self.spoofing) and (pdu.pduSource != self.address):
raise RuntimeError("spoofing address conflict")
# actual network delivery is deferred
deferred(self.lan.process_pdu, pdu)
# actual network delivery is a zero-delay task
OneShotFunction(self.lan.process_pdu, pdu)
def __repr__(self):
return "<%s(%s) at %s>" % (