-
Notifications
You must be signed in to change notification settings - Fork 1
runtime.operation
load runtime.operation
This module provides the Runtime.Operation abstraction used by the runtime scheduler to represent asynchronous I/O work and resume suspended coroutines.
This class describe an asynchronous operation.
Operation objects represent asynchronous tasks executed by Runtime.Scheduler.
An operation encapsulates the logic required to perform a specific asynchronous action such as connecting, reading, writing or accepting connections.
The lifecycle of an operation is typically:
- Created by an endpoint asynchronous method
- Submitted to the scheduler using Runtime.Scheduler.suspend
- Executed until the operation blocks
- Suspended until the required socket event occurs
- Resumed by the scheduler
- Completed when the operation's result is available
This design allows asynchronous operations to be expressed in a sequential style using coroutines while the scheduler handles the underlying event loop and I/O readiness notifications.
| Modifiers | Member | Description |
|---|---|---|
const |
!= | Returns false if other is equal to this operation; otherwise returns true. |
const |
== | Returns true if other is equal to this operation; otherwise returns false. |
const |
check | Checks for completion. Returns true if the operation is completed; otherwise ... |
const |
get | Returns the operation result. |
final const
|
getCoroutine | Returns the coroutine associated with the operation completion. |
final const
|
start | Starts the asynchronous operation. The scheduler is the instance of Runtime.O... |
final const
|
to_async_operation | Returns the pointer to the internal mint::AsyncOperation instance. |
| Modifiers | Member | Description |
|---|---|---|
const |
setup | Returns the operation context pointer. |
| Modifiers | Member | Description |
|---|---|---|
final const
|
getLastResult | Returns the result from the last operation completion. |
| Modifiers | Member | Description |
|---|---|---|
final |
coroutine | Internal associated coroutine. |
final |
d_ptr | Internal operation context pointer. |
@ const
|
g_lib | Global library handle. |
def (const self, const other)
Returns false if other is equal to this operation; otherwise returns true.
def (const self, const other)
Returns true if other is equal to this operation; otherwise returns false.
def (self, result)
Checks for completion. Returns true if the operation is completed; otherwise returns false. An exception
may be raised on error and would be forwarded to the calling coroutine.
null
Internal associated coroutine.
null
Internal operation context pointer.
lib ('libmint-runtime')
Global library handle.
def (self)
Returns the operation result.
def (self)
Returns the coroutine associated with the operation completion.
def (self)
Returns the result from the last operation completion.
def (self, scheduler)
Returns the operation context pointer.
def (self, scheduler, coroutine)
Starts the asynchronous operation. The scheduler is the instance of Runtime.Scheduler that want to start
the operation. The coroutine parameter provides the coroutine associated with the operation execution.
def (self)
Returns the pointer to the internal mint::AsyncOperation instance.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules