<h1>Tradeoff: poll or notify</h1>
<p>
- Filler - need to demonstrate:
+ Polling:
+ <ul>
+ <li>Server cannot report size unless client asks
+ <li>Each server reply sets <code>NBD_REPLY_DONE</code> flag bit
+ <li>Client must ask in a loop when polling for a change from the
+ server
+ </ul>
+<p>
+ <img src="8300-poll.png"/>
<p>
- polling (server cannot tell client about async changes unless client
- polls):
- <br>client: NBD_CMD_RESIZE(0)
- <br>server: NBD_REPLY_TYPE_RESIZE response, including NBD_REPLY_DONE
- <br>do stuff
- <br>client: NBD_CMD_RESIZE(0)
- <br>server: NBD_REPLY_TYPE_RESIZE response, including NBD_REPLY_DONE
+ Notify:
+ <ul>
+ <li>Client uses <code>NBD_CMD_FLAG_RESIZE_NOTIFY</code> to
+ request an open-ended command
+ <li>Server replies with <code>NBD_REPLY_DONE</code> flag clear
+ whenever it has a new size to report
+ </ul>
<p>
- notify (client registers open-ended command to allow multiple async
- server responses as needed):
- <br>client: NBD_CMD_RESIZE(NBD_CMD_FLAG_NOTIFY)
- <br>do stuff
- <br>server: NBD_REPLY_TYPE_RESIZE response, excluding NBD_REPLY_DONE
- <br>do stuff
- <br>server: NBD_REPLY_TYPE_RESIZE response, excluding NBD_REPLY_DONE
+ <img src="8300-notify.png"/>
</p>