Sha256: bc282feba1fc31cf896f0a8df45dc4b278507d147451f03174716f8c4630ff82

Contents?: true

Size: 1.01 KB

Versions: 93

Compression:

Stored size: 1.01 KB

Contents

---
layout: page
title: Polyphony::BaseException
parent: API Reference
permalink: /api-reference/polyphony-baseexception/
---
# Polyphony::BaseException

The `Polyphony::BaseException` is a common base class for exceptions used to
control fiber execution. Instances of descendant classes are meant to be created
explicitly using `new`, e.g. `Polyphony::MoveOn.new`, rather than using `raise
Polyphony::MoveOn`. Normally an application will not use those classes directly
but would rather use APIs such as `Fiber#interrupt`.

## Derived classes

- [`Polyphony::Cancel`](../polyphony-cancel/)
- [`Polyphony::MoveOn`](../polyphony-moveon/)
- [`Polyphony::Restart`](../polyphony-restart/)
- [`Polyphony::Terminate`](../polyphony-terminate/)

## Instance methods

### #initialize(value = nil)

Initializes the exception with an optional result value. The value will be used
as the result of the block being interrupted or the fiber being terminated.

```ruby
f = spin { 'foo' }
f.raise(Polyphony::Terminate.new('bar'))
f.await #=> 'bar'
```

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
polyphony-0.47.5.1 docs/api-reference/polyphony-baseexception.md
polyphony-0.47.5 docs/api-reference/polyphony-baseexception.md
polyphony-0.47.4 docs/api-reference/polyphony-baseexception.md
polyphony-0.47.3 docs/api-reference/polyphony-baseexception.md
polyphony-0.47.2 docs/api-reference/polyphony-baseexception.md
polyphony-0.47.1 docs/api-reference/polyphony-baseexception.md
polyphony-0.47.0 docs/api-reference/polyphony-baseexception.md
polyphony-0.46.1 docs/api-reference/polyphony-baseexception.md
polyphony-0.46.0 docs/api-reference/polyphony-baseexception.md
polyphony-0.45.5 docs/api-reference/polyphony-baseexception.md
polyphony-0.45.4 docs/api-reference/polyphony-baseexception.md
polyphony-0.45.2 docs/api-reference/polyphony-baseexception.md
polyphony-0.45.1 docs/api-reference/polyphony-baseexception.md
polyphony-0.45.0 docs/api-reference/polyphony-baseexception.md
polyphony-0.44.0 docs/api-reference/polyphony-baseexception.md
polyphony-0.43.11 docs/api-reference/polyphony-baseexception.md
polyphony-0.43.10 docs/api-reference/polyphony-baseexception.md
polyphony-0.43.9 docs/api-reference/polyphony-baseexception.md
polyphony-0.43.8 docs/api-reference/polyphony-baseexception.md
polyphony-0.43.6 docs/api-reference/polyphony-baseexception.md