> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.nvidia.com/dynamo/llms.txt. For full content including API reference and SDK examples, see https://docs.nvidia.com/dynamo/llms-full.txt.

# dynamo.nixl_connect

`dynamo.nixl_connect` publishes 17 classes and 0 functions. Source: [`lib/bindings/python/src/dynamo/nixl_connect/__init__.py`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py)

#### AbstractOperation (class)

Abstract base class for awaitable NIXL based RDMA operations.

```python
from dynamo.nixl_connect import AbstractOperation
```

```python
AbstractOperation(connection: Connection, operation_kind: OperationKind, local_descriptors: Descriptor | list[Descriptor], remote_descriptors: Optional[Descriptor | list[Descriptor]], notification_key: Optional[str]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L105`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L105)

**Public methods**

<h4 id="api-dynamo-nixl-connect-abstractoperation-init">
  **init**
</h4>

```python
__init__(connection: Connection, operation_kind: OperationKind, local_descriptors: Descriptor | list[Descriptor], remote_descriptors: Optional[Descriptor | list[Descriptor]], notification_key: Optional[str]) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L110)

<h4 id="api-dynamo-nixl-connect-abstractoperation-wait-for-completion">
  wait_for_completion
</h4>

```python
wait_for_completion() -> None
```

Blocks the caller asynchronously until the operation has completed.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L249)

#### ActiveOperation (class)

Abstract class for active operations that initiates a NIXL based RDMA transfer based `RdmaMetadata` provided by the remote worker's corresponding `PassiveOperation`.

```python
from dynamo.nixl_connect import ActiveOperation
```

```python
ActiveOperation(remote: Remote, operation_kind: OperationKind, local_descriptors: Descriptor | list[Descriptor], remote_descriptors: Descriptor | list[Descriptor], notification_key: str) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L283`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L283)

**Public methods**

<h4 id="api-dynamo-nixl-connect-activeoperation-init">
  **init**
</h4>

```python
__init__(remote: Remote, operation_kind: OperationKind, local_descriptors: Descriptor | list[Descriptor], remote_descriptors: Descriptor | list[Descriptor], notification_key: str) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L289)

<h4 id="api-dynamo-nixl-connect-activeoperation-cancel">
  cancel
</h4>

```python
cancel() -> None
```

Cancels the operation. No affect if the operation has already completed or errored, or has been cancelled.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L518)

#### Connection (class)

No summary available.

```python
from dynamo.nixl_connect import Connection
```

```python
Connection(connector: Connector, number: int)
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L586`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L586)

**Public methods**

<h4 id="api-dynamo-nixl-connect-connection-init">
  **init**
</h4>

```python
__init__(connector: Connector, number: int)
```

Creates a new Connection instance.

**Parameters**

**`connector`** `Connector`

The connector associated with this connection.

---

**`number`** `int`

The connection number.
Used to create a unique name for the connection.

---

**Raises**

* `TypeError` — When `connector` is provided and not of type `dynamo.nixl_connect.Connector`.
* `TypeError` — When `number` is provided and not of type `int`.
* `ValueError` — When `number` is provided and not greater than 0.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L587)

<h4 id="api-dynamo-nixl-connect-connection-acquire-remote-ref">
  acquire_remote_ref
</h4>

```python
acquire_remote_ref(name: str) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L664)

<h4 id="api-dynamo-nixl-connect-connection-release-remote-ref">
  release_remote_ref
</h4>

```python
release_remote_ref(name: str) -> bool
```

Returns True when the last reference is released.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L668)

<h4 id="api-dynamo-nixl-connect-connection-initialize">
  initialize
</h4>

```python
initialize() -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L680)

#### Connector (class)

Core class for managing the connection between workers in a distributed environment. Use this class to create readable and writable operations, or read and write data to remote workers.

```python
from dynamo.nixl_connect import Connector
```

```python
Connector(worker_id: Optional[str] = None) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L692`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L692)

**Public methods**

<h4 id="api-dynamo-nixl-connect-connector-init">
  **init**
</h4>

```python
__init__(worker_id: Optional[str] = None) -> None
```

Creates a new Connector instance.

**Parameters**

**`worker_id`** `Optional[str]`

Unique identifier of the worker, defaults to a new UUID when `None`.

---

**Raises**

* `TypeError` — When `worker_id` is provided and not of type `uuid.UUID`.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L698)

<h4 id="api-dynamo-nixl-connect-connector-begin-read">
  begin_read
</h4>

```python
begin_read(remote_metadata: RdmaMetadata, local_descriptors: Descriptor | list[Descriptor]) -> ReadOperation
```

Creates a read operation for fulfilling a remote readable operation.

**Parameters**

**`remote_metadata`** `RdmaMetadata`

RDMA metadata from a remote worker that has created a readable operation.

---

**`local_descriptors`** `Descriptor | list[Descriptor]`

Local descriptor(s) to receive data from the remote worker described by `remote_metadata`.

---

**Returns**

* `ReadOperation` — Awaitable read operation that can be used to transfer data from a remote worker.

**Raises**

* `TypeError` — When `remote_metadata` is not of type `RdmaMetadata`.
* `TypeError` — When `local_descriptors` is not of type `dynamo.nixl_connect.Descriptor` or `list[dynamo.nixl_connect.Descriptor]`.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L778)

<h4 id="api-dynamo-nixl-connect-connector-begin-write">
  begin_write
</h4>

```python
begin_write(local_descriptors: Descriptor | list[Descriptor], remote_metadata: RdmaMetadata) -> WriteOperation
```

Creates a write operation for transferring data to a remote worker.

**Parameters**

**`local_descriptors`** `Descriptor | list[Descriptor]`

Local descriptors of one or more data objects to be transferred to the remote worker.

---

**`remote_metadata`** `RdmaMetadata`

Serialized request from a remote worker that has created a readable operation.

---

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L826)

<h4 id="api-dynamo-nixl-connect-connector-create-readable">
  create_readable
</h4>

```python
create_readable(local_descriptors: Descriptor | list[Descriptor]) -> ReadableOperation
```

Creates a readable operation for transferring data from a remote worker.

**Returns**

* `ReadableOperation` — A readable operation that can be used to transfer data from a remote worker.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L864)

<h4 id="api-dynamo-nixl-connect-connector-create-writable">
  create_writable
</h4>

```python
create_writable(local_descriptors: Descriptor | list[Descriptor]) -> WritableOperation
```

Creates a writable operation for transferring data to a remote worker.

**Returns**

* `WritableOperation` — A writable operation that can be used to transfer data to a remote worker.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L880)

<h4 id="api-dynamo-nixl-connect-connector-initialize">
  initialize
</h4>

```python
initialize() -> None
```

Deprecated method.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L896)

#### Descriptor (class)

Memory descriptor that ensures memory is registered w/ NIXL, used for transferring data between workers.

```python
from dynamo.nixl_connect import Descriptor
```

```python
Descriptor(data: torch.Tensor | tuple[array_module.ndarray, Device | str] | bytes | tuple[int, int, Device | str, Any]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L919`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L919)

**Public methods**

<h4 id="api-dynamo-nixl-connect-descriptor-init">
  **init**
</h4>

```python
__init__(data: torch.Tensor | tuple[array_module.ndarray, Device | str] | bytes | tuple[int, int, Device | str, Any]) -> None
```

Memory descriptor for transferring data between workers.

**Parameters**

**`data`** `torch.Tensor | tuple[ndarray, Device | str] | bytes | tuple[int, int, Device | str, Any]`

The data to be transferred.

When `torch.Tensor` is provided, the attributes of the tensor will be used to create the descriptor.

When `tuple[ndarray, Device]` is provided, the tuple must contain:

* `ndarray`: The CuPy or NumPy array to be transferred.
* `Device`: Either a `dynamo.nixl_connect.Device` or a string representing the device type (e.g., "cuda" or "cpu").

When `bytes` is provided, the pointer and size derived from the bytes object and memory type will be assumed to be CPU.

When `tuple[int, int, Device|str, Any]` is provided, the tuple must contain the following elements:

* `int`: Pointer to the data in memory.
* `int`: Size of the data in bytes.
* `Device`: Either a `dynamo.nixl_connect.Device` or a string representing the device type (e.g., "cuda" or "cpu").
* `Any`: Optional reference to the data (e.g., the original tensor or bytes object).
  This is useful for keeping a reference to the data in memory, but it is not required.

---

**Raises**

* `ValueError` — When `data` is `None`.
* `TypeError` — When `data` is not a valid type (i.e., not `torch.Tensor`, `bytes`, or a valid tuple).
* `TypeError` — When `data` is a tuple but the elements are not of the expected types (i.e., \[`ndarray`, `Device|str`] OR \[`int`, `int`, `Device|str`, `Any`]).

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L924)

<h4 id="api-dynamo-nixl-connect-descriptor-from-serialized">
  from_serialized
</h4>

```python
from_serialized(serialized: SerializedDescriptor) -> Descriptor
```

Deserializes a `SerializedDescriptor` into a `Descriptor` object.

**Parameters**

**`serialized`** `SerializedDescriptor`

The serialized descriptor to deserialize.

---

**Returns**

* `Descriptor` — The deserialized descriptor.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1117)

<h4 id="api-dynamo-nixl-connect-descriptor-deregister-with-connector">
  deregister_with_connector
</h4>

```python
deregister_with_connector(connection: Connection) -> None
```

Deregisters the memory of the descriptor with NIXL.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1153)

<h4 id="api-dynamo-nixl-connect-descriptor-register-with-connector">
  register_with_connector
</h4>

```python
register_with_connector(connection: Connection) -> None
```

Registers the memory of the descriptor with NIXL.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1181)

#### Device (class)

Represents a device in the system.

```python
from dynamo.nixl_connect import Device
```

```python
Device(metadata: str | tuple[DeviceKind, int]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1283`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1283)

**Public methods**

<h4 id="api-dynamo-nixl-connect-device-init">
  **init**
</h4>

```python
__init__(metadata: str | tuple[DeviceKind, int]) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1288)

#### DeviceKind (class)

Type of memory a descriptor has been allocated to.

```python
from dynamo.nixl_connect import DeviceKind
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1353`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1353)

#### OperationKind (class)

Kind of an operation.

```python
from dynamo.nixl_connect import OperationKind
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1396`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1396)

#### OperationStatus (class)

Status of an operation.

```python
from dynamo.nixl_connect import OperationStatus
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1414`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1414)

#### PassiveOperation (class)

Abstract class for common functionality of passive operations.

```python
from dynamo.nixl_connect import PassiveOperation
```

```python
PassiveOperation(connection: Connection, operation_kind: OperationKind, local_descriptors: Descriptor | list[Descriptor]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1452`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1452)

**Public methods**

<h4 id="api-dynamo-nixl-connect-passiveoperation-init">
  **init**
</h4>

```python
__init__(connection: Connection, operation_kind: OperationKind, local_descriptors: Descriptor | list[Descriptor]) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1457)

<h4 id="api-dynamo-nixl-connect-passiveoperation-metadata">
  metadata
</h4>

```python
metadata(hex_encode: bool = False) -> RdmaMetadata
```

Gets the request descriptor for the operation.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1520)

<h4 id="api-dynamo-nixl-connect-passiveoperation-wait-for-completion">
  wait_for_completion
</h4>

```python
wait_for_completion() -> None
```

Blocks the caller asynchronously until the operation has completed.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1606)

#### RdmaMetadata (class)

Pydantic serialization type for describing the passive side of a transfer.

```python
from dynamo.nixl_connect import RdmaMetadata
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1758`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1758)

**Public methods**

<h4 id="api-dynamo-nixl-connect-rdmametadata-to-descriptors">
  to_descriptors
</h4>

```python
to_descriptors() -> Descriptor | list[Descriptor]
```

Deserializes the request descriptor into a `dynamo.nixl_connect.Descriptor` or list of `dynamo.nixl_connect.Descriptor` objects.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1773)

<h4 id="api-dynamo-nixl-connect-rdmametadata-validate-operation-kind">
  validate_operation_kind
</h4>

```python
validate_operation_kind(cls, v: int) -> int
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1785)

#### ReadOperation (class)

Operation that initiates an RDMA read operation to transfer data from a remote worker's `ReadableOperation`, as described by `remote_metadata`, to local buffers.

```python
from dynamo.nixl_connect import ReadOperation
```

```python
ReadOperation(connection: Connection, remote_metadata: RdmaMetadata, local_descriptors: Descriptor | list[Descriptor]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1614`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1614)

**Public methods**

<h4 id="api-dynamo-nixl-connect-readoperation-init">
  **init**
</h4>

```python
__init__(connection: Connection, remote_metadata: RdmaMetadata, local_descriptors: Descriptor | list[Descriptor]) -> None
```

Creates a new instance of `ReadOperation`, registers `local_descriptors` with NIXL, and begins an RDMA read operation which will transfer data described by `remote_metadata` to `local_descriptors`.

**Parameters**

**`connection`** `Connection`

Connection instance to use for the operation.

---

**`remote_metadata`** `RdmaMetadata`

Serialized request from the remote worker.

---

**`local_descriptors`** `Descriptor | list[Descriptor]`

Local descriptor(s) to to receive the data from the remote worker.

---

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1620)

<h4 id="api-dynamo-nixl-connect-readoperation-cancel">
  cancel
</h4>

```python
cancel() -> None
```

Cancels the operation. No affect if the operation has already completed or errored, or been cancelled.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1692)

<h4 id="api-dynamo-nixl-connect-readoperation-results">
  results
</h4>

```python
results() -> list[Descriptor]
```

Gets the results of the operation. Returns a single descriptor if only one was requested, or a list of descriptors if multiple were requested.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1699)

<h4 id="api-dynamo-nixl-connect-readoperation-wait-for-completion">
  wait_for_completion
</h4>

```python
wait_for_completion() -> None
```

Blocks the caller asynchronously until the operation has completed.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1713)

#### ReadableOperation (class)

Operation that can be awaited until a remote worker has completed a `ReadOperation`.

```python
from dynamo.nixl_connect import ReadableOperation
```

```python
ReadableOperation(connection: Connection, local_descriptors: Descriptor | list[Descriptor]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1720`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1720)

**Public methods**

<h4 id="api-dynamo-nixl-connect-readableoperation-init">
  **init**
</h4>

```python
__init__(connection: Connection, local_descriptors: Descriptor | list[Descriptor]) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1725)

<h4 id="api-dynamo-nixl-connect-readableoperation-wait-for-completion">
  wait_for_completion
</h4>

```python
wait_for_completion() -> None
```

Blocks the caller asynchronously until the operation has completed.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1751)

#### Remote (class)

Identifies a remote NIXL enabled worker relative to a local NIXL enabled worker.

```python
from dynamo.nixl_connect import Remote
```

```python
Remote(connection: Connection, nixl_metadata: bytes | str) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1795`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1795)

**Public methods**

<h4 id="api-dynamo-nixl-connect-remote-init">
  **init**
</h4>

```python
__init__(connection: Connection, nixl_metadata: bytes | str) -> None
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1800)

#### SerializedDescriptor (class)

Pydantic serialization type for memory descriptors.

```python
from dynamo.nixl_connect import SerializedDescriptor
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1883`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1883)

**Public methods**

<h4 id="api-dynamo-nixl-connect-serializeddescriptor-to-descriptor">
  to_descriptor
</h4>

```python
to_descriptor() -> Descriptor
```

Deserialize the serialized descriptor into a `Descriptor` object.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1898)

<h4 id="api-dynamo-nixl-connect-serializeddescriptor-validate-device">
  validate_device
</h4>

```python
validate_device(cls, v: str) -> str
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1904)

<h4 id="api-dynamo-nixl-connect-serializeddescriptor-validate-ptr">
  validate_ptr
</h4>

```python
validate_ptr(cls, v: int) -> int
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1916)

<h4 id="api-dynamo-nixl-connect-serializeddescriptor-validate-size">
  validate_size
</h4>

```python
validate_size(cls, v: int) -> int
```

No summary available.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1923)

#### WritableOperation (class)

Operation which can be awaited until written to by a `WriteOperation` from a remote worker.

```python
from dynamo.nixl_connect import WritableOperation
```

```python
WritableOperation(connection: Connection, local_descriptors: Descriptor | list[Descriptor]) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1933`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1933)

**Public methods**

<h4 id="api-dynamo-nixl-connect-writableoperation-init">
  **init**
</h4>

```python
__init__(connection: Connection, local_descriptors: Descriptor | list[Descriptor]) -> None
```

Creates a new instance of `WritableOperation`, registers the operation and descriptors w/ NIXL, and enables an RDMA write operation to occur.

**Parameters**

**`connection`** `Connection`

Connection instance to use for the operation.

---

**`local_descriptors`** `Descriptor | list[Descriptor]`

Descriptors to receive data from a remote worker.

---

**`Raises`**

---

**`TypeError`**

When `connection` is not a `dynamo.nixl_connect.Connection`.

---

**`TypeError`**

When `local_descriptors` is not a `dynamo.nixl_connect.Descriptor` or `list[dynamo.nixl_connect.Descriptor]`.

---

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1938)

<h4 id="api-dynamo-nixl-connect-writableoperation-wait-for-completion">
  wait_for_completion
</h4>

```python
wait_for_completion() -> None
```

Blocks the caller asynchronously until the operation has completed.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1981)

#### WriteOperation (class)

Awaitable write operation which initiates an RDMA write operation to a remote worker which provided a `RdmaMetadata` object from a `WritableOperation`.

```python
from dynamo.nixl_connect import WriteOperation
```

```python
WriteOperation(connection: Connection, local_descriptors: Descriptor | list[Descriptor], remote_metadata: RdmaMetadata) -> None
```

[`lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1988`](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1988)

**Public methods**

<h4 id="api-dynamo-nixl-connect-writeoperation-init">
  **init**
</h4>

```python
__init__(connection: Connection, local_descriptors: Descriptor | list[Descriptor], remote_metadata: RdmaMetadata) -> None
```

Creates a new instance of `WriteOperation`, registers `local_descriptors` with NIXL, and begins an RDMA write operation which will transfer from `local_descriptors` to remote target(s) described by `remote_metadata`

**Parameters**

**`connection`** `Connection`

Connection instance to use for the operation.

---

**`local_descriptors`** `Descriptor | list[Descriptor]`

Local descriptor(s) to send from, to the remote worker.

---

**`remote_metadata`** `RdmaMetadata`

Serialized request from the remote worker that describes the target(s) to send to.

---

**`Raises`**

---

**`TypeError`**

When `connector` is not a `dynamo.nixl_connect.Connector`.

---

**`TypeError`**

When `remote_metadata` is not a `dynamo.nixl_connect.RdmaMetadata`.

---

**`ValueError`**

When `remote_metadata` is not of kind `WRITE`.

---

**`ValueError`**

When `remote_metadata.nixl_metadata` is not a non-empty `str`.

---

**`TypeError`**

When `local_descriptors` is not a `dynamo.nixl_connect.Descriptor` or `list[dynamo.nixl_connect.Descriptor]`.

---

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L1994)

<h4 id="api-dynamo-nixl-connect-writeoperation-cancel">
  cancel
</h4>

```python
cancel() -> None
```

Cancels the operation. No affect if the operation has already completed or errored, or has been cancelled.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L2067)

<h4 id="api-dynamo-nixl-connect-writeoperation-wait-for-completion">
  wait_for_completion
</h4>

```python
wait_for_completion() -> None
```

Blocks the caller asynchronously until the operation has completed.

[source](https://github.com/ai-dynamo/dynamo/blob/main/lib/bindings/python/src/dynamo/nixl_connect/__init__.py#L2074)