craigerl / aprsd

Amateur radio APRS daemon which listens for messages and responds. By KM6LYW.
Apache License 2.0
124 stars 19 forks source link

Threads #26

Closed hemna closed 3 years ago

hemna commented 3 years ago

Reworked the threading around consuming messages from aprs, as well as processing messages.

All threads are based off of the new APRSDThread class. This allows for looping over the thread based thread_stop var. When aprsd exits via CTRL-C, it loops through all outstanding threads and calls stop on them all. Each thread stops looping when thread_stop is set to True. This ensures that all threads can exit with the user wants aprsd to exit.

Added new MsgTrack object to replace the ack_dict, which wasn't thread safe. the MsgTrack object can save/load it's list of messages to disk. when aprsd exits, all threads are stopped, and MsgTrack data is pickled and saved to ~/.config/aprsd/aprsd.p file. When aprsd server is restarted, the MsgTrack data is loaded from disk and any messages that hadn't completed the cycle of send/retry are restarted automatically.

New QueryPlugin is created to get the list of messages in the MsgTrack queue. QueryPlugin allows configured user to force a resend of all Delayed messages. QueryPlugin allows configured user to force a delete/flush of all messages in MsgTrack.