sync is an API-only function which waits until all current commands have been executed before returning. A timeout can be used to insure that this command eventually returns.
cmd.sync(float timeout=1.0,float poll=0.05)
frame