Example #1
0
def _WatcherHandler(handler_uuid, of_blob_ptr):
    uuid2handler = session_ctx.GetDefaultSession().uuid2watch_handler
    assert handler_uuid in uuid2handler
    blob_watched, handler = uuid2handler[handler_uuid]
    assert callable(handler)
    ndarray_lists = ofblob.OfBlob(of_blob_ptr).CopyToNdarrayLists()
    local_blob = local_blob_util.MakeLocalBlob(ndarray_lists, blob_watched)
    handler(oft_util.TransformWatchedBlob(local_blob, handler))
Example #2
0
 def AccessOfBlobPtr(ofblob_ptr):
     ofblob = ofblob_util.OfBlob(ofblob_ptr)
     Yield(callback(ofblob))
Example #3
0
def _WatcherHandler(unique_id, of_blob_ptr):
    global unique_id2handler
    assert unique_id in unique_id2handler
    handler = unique_id2handler[unique_id]
    assert callable(handler)
    handler(ofblob.OfBlob(of_blob_ptr))
Example #4
0
 def PullBlob(self, of_blob_ptr):
     try:
         self.pull_cb_(ofblob.OfBlob(of_blob_ptr))
     except Exception as e:
         print(traceback.format_exc())
         raise e