From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 4 Jun 2019 10:59:31 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH v2] core: Non-blocking io.popen Message-ID: <20190604075931.w3y5th6k7b7b7v4a@esperanza> References: <20190529070809.18962-1-szudin@tarantool.org> <20190530183438.m7p4mj6zzekdmfr3@esperanza> <81776c14-b970-09b7-600a-0ef114876f12@tarantool.org> <20190603172525.cia2tkbjui56rbaj@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Stanislav Zudin Cc: Alexander Turenko , tarantool-patches@freelists.org, Georgy Kirichenko List-ID: 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.