/// <summary> /// Initializes a new instance of the <see cref="UvIdle"/> handle. /// </summary> /// <param name="loop">Loop, on which this handle will be initialized.</param> /// <param name="callback">Callback, which will be invoked every loop iteration.</param> /// <param name="state">A state object to be stored in the handle for later use inside the callback.</param> public UvIdle(UvLoop loop, Action <UvIdle> callback, object state = null) : base(loop, UvHandleType.Idle) { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } this._Callback = callback; this._State = state; Libuv.EnsureSuccess(Libuv.uv_idle_init(loop, this)); this.NeedsToBeClosed = true; }