Change in vdsm[master]: link monitor: Add optional asynchronous operation

nsoffer at redhat.com nsoffer at redhat.com
Fri Dec 6 13:12:21 UTC 2013


Nir Soffer has posted comments on this change.

Change subject: link monitor: Add optional asynchronous operation
......................................................................


Patch Set 6:

(4 comments)

....................................................
Commit Message
Line 3: AuthorDate: 2013-11-19 17:26:47 +0100
Line 4: Commit:     Antoni S. Puimedon <asegurap at redhat.com>
Line 5: CommitDate: 2013-12-04 17:53:17 +0100
Line 6: 
Line 7: link monitor: Add optional asynchronous operation
Looks good
Line 8: 
Line 9: Apart from the current way of operating a moniter:
Line 10:     mon = Monitor()
Line 11:     mon.start()


Line 10:     mon = Monitor()
Line 11:     mon.start()
Line 12:     ....
Line 13:     mon.stop()
Line 14:     eventList = mon.events()
Sound racy - how can you ensure that you get all events that happened between stop and next start?
Line 15: 
Line 16: Now it is possible to do (async iteration):
Line 17:     mon = Monitor()
Line 18:     mon.start()


Line 23:     mon = Monitor()
Line 24:     mon.start()
Line 25:     mon.stop()
Line 26:     for event in mon:
Line 27:         do things with the event
Because of the race in stopping a monitor.
Line 28: 
Line 29: This is the first step towards having a thread that keeps netinfo
Line 30: updated by events.
Line 31: 


....................................................
File lib/vdsm/ipwrapper.py
Line 553:     Can be used in synchronous and asynchronous mode:
Line 554:         mon = Monitor()
Line 555:         mon.start()
Line 556:         ....
Line 557:         mon.stop()  # This makes it synced iteration.
You and me know that but the docstring does not tell that.
Line 558:         for event in mon:
Line 559:             print event
Line 560:     """
Line 561:     _DELETED_TEXT = 'Deleted'


-- 
To view, visit http://gerrit.ovirt.org/21430
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib8ca850fc324a5b4c0268541fd4d4d062706a159
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list