# Class: Concurrent::Promises::ResolvableEvent

Inherits:
  Event
  - Object
  - Synchronization::Object
  - AbstractEventFuture
  - Event
  - Concurrent::Promises::ResolvableEvent
  show all

Includes:
  Resolvable

Defined in:
  lib/concurrent/promises.rb

## Overview

A Event which can be resolved by user.

## Instance Method Summary collapse

- #resolve(raise_on_reassign = true) ⇒ self, false

  Makes the event resolved, which triggers all dependent futures.

- #with_hidden_resolvable ⇒ Event

  Creates new event wrapping receiver, effectively hiding the resolve method.

## Instance Method Details

### #resolve(raise_on_reassign = true) ⇒ `self`, `false`

Makes the event resolved, which triggers all dependent futures.

Parameters:

- raise_on_reassign (`Boolean`) (defaults to: `true`) —

  should method raise exception if already resolved

Returns:

- (`self`, `false`) —

  false is returner when raise_on_reassign is false and the receiver is already resolved.

    1230
    1231
    1232

    # File 'lib/concurrent/promises.rb', line 1230

    def resolve(raise_on_reassign = true)
      resolve_with RESOLVED, raise_on_reassign
    end

### #with_hidden_resolvable ⇒ `Event`

Creates new event wrapping receiver, effectively hiding the resolve method.

Returns:

- (`Event`)

    1237
    1238
    1239

    # File 'lib/concurrent/promises.rb', line 1237

    def with_hidden_resolvable
      @with_hidden_resolvable ||= EventWrapperPromise.new_blocked_by1(self, @DefaultExecutor).event
    end