This commit is contained in:
21
docs/snippets/elixir/api/extract_file_async.md
Normal file
21
docs/snippets/elixir/api/extract_file_async.md
Normal file
@@ -0,0 +1,21 @@
|
||||
```elixir title="Elixir"
|
||||
defmodule Example do
|
||||
def extract_file_async do
|
||||
config = nil
|
||||
|
||||
task = Task.async(fn ->
|
||||
Kreuzberg.extract_file_async("document.pdf", nil, config)
|
||||
end)
|
||||
|
||||
case Task.await(task) do
|
||||
{:ok, result} ->
|
||||
IO.puts("Content: #{result}")
|
||||
:ok
|
||||
|
||||
{:error, reason} ->
|
||||
IO.puts("Error: #{reason}")
|
||||
:error
|
||||
end
|
||||
end
|
||||
end
|
||||
```
|
||||
Reference in New Issue
Block a user