Personal tools
You are here: Home Issue Tracker Reimplementing communications using twisted
Document Actions

#35 — Reimplementing communications using twisted

State In progress
Release:
Area Core Software
Issue type Feature
Severity Important
Submitted by Sébastien Lelong
Submitted on 2008-11-27
Responsible Sébastien Lelong
Target release: 0.3
Return to tracker
Last modified on 2009-03-01 by Sébastien Lelong
By the time I started to create threads, queues, etc... I wondered if I was just needed to implement this using twisted. No threads, just some defers. Better, cleaner code. Now I try to add entry point to listen to some different objects (chars, frame, events, request, response, message, etc...), by adding a pubsub pattern with queues, by implementing a naive event model, while this seems more and more complicated, using "one more thread but the last I promise", it's time to switch to twisted, which has all of these (almost) built-in.

Impacts are:

 * rs232.py : use a semaphore. Not needed anymore, because no more threads. Can be left as is though
 * frame.py : frame managers use queues and threads to read/write chars. Big changes here
 * job.py : define background task, etc... which can be implemented back to twisted without threads (I think). JobManager can stay, but needs a way to control twisted-based jobs.
Added by Sébastien Lelong on 2008-11-27 08:14
Issue state: unconfirmedopen
Added by Sébastien Lelong on 2009-02-27 16:25
Issue state: openin-progress
- rs232.py is just a wrapper over twisted serial transport
- job.py stays as is, for now, as "kind of" deprecated. I wonder if I need to integrate a job manager instead of developing a new one. Or I wonder if jobs should be created at GUI level. What about @poll decorator ? It uses job.py !!! Needs migration.
- frame.py: big changes here. All those frame managers disappear in favor of one unique and highly configurable manager. Parsing frame has been re-implemented and debugged.

This issue is closed to be closed...
Added by Sébastien Lelong on 2009-03-01 09:55
rs232.py can't just be a wrapper around twisted.internet.serialport. Because of echo. Before Twisted, echo was handled in rs232 communicator object: where allow_echo = True, then for each sent byte, one is read, and assets both sent/received are the same. Done in rs232 layer, not in frame manager, because echo is about lower layer, not frame themselves.

Powered by My Hands Powered by Jalv2 Hosted by Google Code