reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Weimer <mar...@weimo.de>
Subject Re: Why IMRU IMapFunction and IUpdateFunction are not disposable?
Date Fri, 05 Aug 2016 16:36:49 GMT
On 2016-08-04 3:24 PM, Mariia Mykhailova wrote:
> It seems that map and update functions in IMRU should be disposable,
> because they are user-provided and stateful and thus might have some
> resources which should be released after job completion. Is there a
> reason why they are not disposable?

If we make them `IDisposable`, all such functions have to implement the 
`.Dispose()` method, right? Couldn't we change the IMRU tasks such that 
they check whether a specific user provided function implements 
`IDisposable` and, if so, calls `.Dispose()` on it? That way, we don't 
broaden the required interfaces, yet support disposing. Or is that an 
anti-pattern in .NET?

Thanks,

Markus

Mime
View raw message