---
title: "VoidCallback"
sidebar_label: "VoidCallback"
description: "Kotlin binding reference: VoidCallback."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[VoidCallback](index.md)

# VoidCallback

[common]\
fun interface [VoidCallback](index.md)

A callback with no payload: the deleter of a wrapped buffer ([Tensors.fromBlob](../Tensors/fromBlob.md) / [Tensors.fromBlobStrided](../Tensors/fromBlobStrided.md)). The runtime runs it exactly once, when the last reference to the wrapping tensor drops, on whichever thread that happens; the callback already holds the buffer it is being told to release, so nothing is passed.

```kotlin
val adopted = Tensors.fromBlob(buf, longArrayOf(8), deleter = VoidCallback {
    println("buffer released")
})
```

An exception the callback lets escape is handed to the calling thread's uncaught-exception handler (the JVM's own reporting path) and never reaches the runtime.

## Functions

| Name | Summary |
|---|---|
| [run](run.md) | [common]<br>abstract fun [run](run.md)() |