OOM Notify refactoring

Now `NotifyOnOOM` is in `cgroups` package and should be used with path to `memory` cgroup, which can be obtained from container `State`
+1 for not having state as an argument. But a method of state seems weird
to me. One option is to wait for the new API to get rid of the state
argument.

On Sun, Dec 21, 2014 at 8:51 AM, Alexander Morozov <notifications@github.com
> wrote:

> In cgroups/notify_linux.go
> <https://github.com/docker/libcontainer/pull/307#discussion-diff-22148698>
> :
>
> > -		return nil, err
> > -	}
> > -
> > -	return notifyOnOOM(d)
> > -}
> > -
> > -func notifyOnOOM(d *data) (<-chan struct{}, error) {
> > -	dir, err := d.path("memory")
> > -	if err != nil {
> > -		return nil, err
> > -	}
> > -
> > +// NotifyOnOOM returns channel on which you can expect event about OOM,
> > +// if process died without OOM this channel will be closed.
> > +// dir should be path to memory cgroup
> > +func NotifyOnOOM(dir string) (<-chan struct{}, error) {
>
> Maybe then as method of State? Why argument?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/docker/libcontainer/pull/307/files#r22148698>.
>