<div dir="ltr">I wanted to float two ideas related to the neutron callback mechanism that is being moved to neutron-lib.<div><br></div><div>1) API</div><div>The current API uses kwargs as a way for the notifier to pass information to the subscribers listening (callbacks). One issue with this, is that the actual keyword arguments used, could clash with the positional argument names.</div><div><br></div><div>To address this, I'm proposing that we do the same as is done in the Requests package to pass a payload to the get() method, where a 'params' positional argument is used to hold a dict with the arguments to be passed to the callback.</div><div><br></div><div>I've pushed a commit to neutron-lib for review <a href="https://review.openstack.org/265997">https://review.openstack.org/265997</a>. Please provide your comments on that as a proposed solution.</div><div><br></div><div>2) Migrating callbacks in neutron to use neutron-lib</div><div>I was thinking that the following plan (A) could work, as a way to migrate to using the callback mechanism in neutron-lib:</div><div><ol><li>In neutron, where callback notifications are performed, add a duplicate notification to the neutron-lib callback notification.</li><li>In each client repo, change the subscription to subscribe to the neutron-lib version of the resource/event tuple. At this time, the clients could be altered to use the new 'params' positional argument</li><li>Once all the client repos have been updated, remove the old notification calls from neutron, the callback code, and callback UTs.</li></ol><div>An alternative proposal (B), *may* be to:</div></div><div><ol><li>Change the notification wrapper method in registry.py to call both the existing callback notify() and the one in neutron_lib. For the latter, the kwargs would need to be stored in the params dict.</li><li>This and next step are the same as in proposal (A).</li></ol><div>I think plan A gives more flexibility in converting kwargs into a param dict, at the expense of more of a change impact (32 places/9 files).</div></div><div><br></div><div>Looking forward to community feedback on this...</div><div><br></div><div>Regards,</div><div><br></div><div>Paul Michali (pc_m)</div><div><br></div></div>