tahrir icon indicating copy to clipboard operation
tahrir copied to clipboard

Make relationship between broadcast classes more explicit

Open nomel7 opened this issue 12 years ago • 0 comments

Currently MicroblogHandler works fine along with MicroblogSessionImpl but things are perhaps not as explicit as they should be. MicroblogHandler really has two "loops" one to move through Microblogs and another to move through peers broadcasting the particular Microblog chosen. These loops, especially the one iterating through peers broadcasting a particular message, are not as explicit as they should be and could cause for some bad bugs if changed down the line.

The main problem is with startBroadcastToPeer() being called recursively from outside MicroblogHandler which is not at all obvious. One solution might be to pass a thread into the session and then, once the session is complete, sent a notify message in order to get the next peer for the next session.

nomel7 avatar Jun 25 '12 17:06 nomel7