mirror of
https://github.com/craigerl/aprsd.git
synced 2024-09-26 07:06:41 -04:00
Added some missing classes to threads
Added new APRSDupeThread
This commit is contained in:
parent
b14307270c
commit
e89f8a805b
@ -4,7 +4,7 @@ import queue
|
|||||||
# aprsd.threads
|
# aprsd.threads
|
||||||
from .aprsd import APRSDThread, APRSDThreadList # noqa: F401
|
from .aprsd import APRSDThread, APRSDThreadList # noqa: F401
|
||||||
from .keep_alive import KeepAliveThread # noqa: F401
|
from .keep_alive import KeepAliveThread # noqa: F401
|
||||||
from .rx import APRSDRXThread # noqa: F401
|
from .rx import APRSDRXThread, APRSDDupeRXThread, APRSDProcessPacketThread # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
packet_queue = queue.Queue(maxsize=20)
|
packet_queue = queue.Queue(maxsize=20)
|
||||||
|
@ -58,12 +58,13 @@ class APRSDRXThread(APRSDThread):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class APRSDPluginRXThread(APRSDRXThread):
|
class APRSDDupeRXThread(APRSDRXThread):
|
||||||
"""Process received packets.
|
"""Process received packets.
|
||||||
|
|
||||||
This is the main APRSD Server command thread that
|
This is the main APRSD Server command thread that
|
||||||
receives packets from APRIS and then sends them for
|
receives packets and makes sure the packet
|
||||||
processing in the PluginProcessPacketThread.
|
hasn't been seen previously before sending it on
|
||||||
|
to be processed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def process_packet(self, *args, **kwargs):
|
def process_packet(self, *args, **kwargs):
|
||||||
@ -118,6 +119,13 @@ class APRSDPluginRXThread(APRSDRXThread):
|
|||||||
self.packet_queue.put(packet)
|
self.packet_queue.put(packet)
|
||||||
|
|
||||||
|
|
||||||
|
class APRSDPluginRXThread(APRSDDupeRXThread):
|
||||||
|
""""Process received packets.
|
||||||
|
|
||||||
|
For backwards compatibility, we keep the APRSDPluginRXThread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class APRSDProcessPacketThread(APRSDThread):
|
class APRSDProcessPacketThread(APRSDThread):
|
||||||
"""Base class for processing received packets.
|
"""Base class for processing received packets.
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ msg_throttle_decorator = decorator.ThrottleDecorator(throttle=msg_t)
|
|||||||
ack_throttle_decorator = decorator.ThrottleDecorator(throttle=ack_t)
|
ack_throttle_decorator = decorator.ThrottleDecorator(throttle=ack_t)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@msg_throttle_decorator.sleep_and_retry
|
||||||
def send(packet: core.Packet, direct=False, aprs_client=None):
|
def send(packet: core.Packet, direct=False, aprs_client=None):
|
||||||
"""Send a packet either in a thread or directly to the client."""
|
"""Send a packet either in a thread or directly to the client."""
|
||||||
# prepare the packet for sending.
|
# prepare the packet for sending.
|
||||||
|
Loading…
Reference in New Issue
Block a user