[tarantool-patches] Re: [PATCH v2] core: Non-blocking io.popen
Vladimir Davydov
vdavydov.dev at gmail.com
Tue Jun 4 10:59:31 MSK 2019
On Tue, Jun 04, 2019 at 10:11:15AM +0300, Stanislav Zudin wrote:
>
>
> On 03.06.2019 20:25, Alexander Turenko wrote:
> > > > Come to think of it, we might need an explicit knob to destroy an object
> > > > even before it's collected. May be, consider re-adding close() for this?
> > > > Please consult with Alexander and/or Georgy re this.
> > > >
> > >
> > > Sasha, George, what do you think?
> >
> > I'm a bit out of context. Why we need explicit close()? To control
> > reaching a file descriptor limit? It can be worked around with
> > `handle = nil collectgarbage()`, but an explicit close() looks better.
> > Maybe it worth to add.
> >
>
> For now there is wait() as a final method. It waits for process termination
> and releases resources.
We might want to read process output after waiting for it to complete.
Or it doesn't make any sense?
> So the question was: should we add close() to release resources
> explicitly?
> Anyway there is a finalizer who performs a final cleanup for the case when
> user forgot to do it.
To trigger the finalizer, we need to delete the variable
p = nil
which isn't very user friendly IMO.
More information about the Tarantool-patches
mailing list