Closed JonnyKong closed 4 years ago
This is designated behavior. If register() works before it is connected, there is no need for route() function.
This is designated behavior. If register() works before it is connected, there is no need for route() function.
Do you mean you intend users to use route()
, even if it's not called in a decorator-style?
This is designated behavior. If register() works before it is connected, there is no need for route() function.
Do you mean you intend users to use
register()
, even if it's not called in a decorator-style?
Yes. However, for your code, why not just make _on_insert_interest() nested functions? I don't think other parts of your program needs to call it directly. If they do, write the implementation function outside and write a wrapper function handling the content decoding inside.
Currently, if
app.register()
is called before the tcp face is ready, it causes the errorNetworkError: cannot send packet before connected
.In some cases, this forces users to abuse the use of
app.route()
, for example:https://github.com/JonnyKong/ndn-python-repo/blob/37ba6b9e754eff04581f8b8b8afa30b40255fb65/ndn_python_repo/handle/write_command_handle.py#L42-L48