Files
fil/docs/snippets/elixir/api/extract_bytes_async.md

23 lines
451 B
Markdown
Raw Permalink Normal View History

2026-06-01 23:40:55 +02:00
```elixir title="Elixir"
defmodule Example do
def extract_from_bytes_async do
content = File.read!("document.pdf")
config = nil
task = Task.async(fn ->
Kreuzberg.extract_bytes_async(content, "application/pdf", config)
end)
case Task.await(task) do
{:ok, result} ->
IO.puts("Content: #{result}")
:ok
{:error, reason} ->
IO.puts("Error: #{reason}")
:error
end
end
end
```