# MotionAwaiter

The awaiter used by await handle. Waiting ends on either completion or cancellation.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public readonly struct MotionAwaiter : ICriticalNotifyCompletion
```

[Runtime/Lifecycle/MotionAwaiter.cs · L10](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L10)

## MotionAwaiter

Create an awaiter for this handle.

```csharp
public MotionAwaiter(MotionHandle handle)
```

Parameters

- `handle` (`MotionHandle`) Handle to control or link.

[Runtime/Lifecycle/MotionAwaiter.cs · L13](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L13)

## GetAwaiter

Return this awaiter.

```csharp
public MotionAwaiter GetAwaiter()
```

Return value

- Returns: `MotionAwaiter`

[Runtime/Lifecycle/MotionAwaiter.cs · L14](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L14)

## IsCompleted

The wait can finish synchronously when the handle is inactive.

```csharp
public bool IsCompleted { get; }
```

[Runtime/Lifecycle/MotionAwaiter.cs · L15](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L15)

## GetResult

Finish a direct await without returning a value.

```csharp
public void GetResult()
```

[Runtime/Lifecycle/MotionAwaiter.cs · L16](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L16)

## OnCompleted

Register the continuation to run when the wait ends.

```csharp
public void OnCompleted(Action continuation)
```

Parameters

- `continuation` (`Action`) Continuation to invoke when the wait finishes.

[Runtime/Lifecycle/MotionAwaiter.cs · L17](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L17)

## UnsafeOnCompleted

Attach the continuation to an active motion or invoke it immediately if already inactive.

```csharp
public void UnsafeOnCompleted(Action continuation)
```

Parameters

- `continuation` (`Action`) Continuation to invoke when the wait finishes.

[Runtime/Lifecycle/MotionAwaiter.cs · L18](../../../source/Runtime/Lifecycle/MotionAwaiter.cs.html#L18)
