    public func {{ method_name }}({{ params }}) async throws -> AsyncThrowingStream<{{ item_type }}, Error> {
        let inner = self.inner
        let handle = try await Task.detached(priority: .userInitiated) {
            try RustBridge.{{ start_fn }}(inner{{ call_args }})
        }.value

        return AsyncThrowingStream<{{ item_type }}, Error> { continuation in
            let task = Task.detached(priority: .userInitiated) {
                do {
                    while !Task.isCancelled {
                        let json = try handle.next().toString()
                        if json.isEmpty { break }
{{ chunk_decode }}                        continuation.yield(chunk)
                    }
                    continuation.finish()
                } catch {
                    continuation.finish(throwing: error)
                }
            }
            continuation.onTermination = { _ in task.cancel() }
        }
    }
