On Sun, Mar 25, 2018 at 2:05 PM, Jameson Nash <[email protected]> wrote:
> > unless uv_close() keeps track of currently outstanding requests and > Libuv keeps track of all outstanding requests (how else would it have > known who to notify for completion) > So, can I rely on uv_close callback to be invoked after all outstanding requests (on handle being closed) are canceled (and their callbacks are invoked)? > > how to cleanly shutdown a running event loop? > Libuv is designed for use from nodejs, which runs the event loop until all > workers are closed and requests handed. To shutdown cleanly, wait for all > outstanding requests to complete and then close all handles. > Does it mean there is no way to (cleanly) shutdown event loop without adding some extra logic into my code? Think of typical tcp echo server example -- lets say you want it cleanly exit (without leaks) if user sent a byte with certain value (e.g. 255) -- how to do it? > > What if during unwinding I will submit another request or try to open a > new handle? > You will have to decide how your application needs to handle this. > > >> Same for uv_fs_t -- I can submit two write requests that will try to >> update different locations in the same file. If these writes are >> immediately "converted" to async/overlapped requests >> > Yes, there's a long-standing bug / PR that libuv sometimes assumes that fs > writes simply can't fail: https://github.com/libuv/ > libuv/pull/269#discussion_r28131975 > Great... -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
