Fluffy.Download (Fluffy v0.7.0)

Copy Markdown View Source

A download available as soon as downloading starts.

suggested_filename and url are available to event predicates. Read or save the contents separately; those operations wait for completion and raise on download failure. Handles belong to their session; saved files outlive it.

Summary

Functions

Waits for completion and reads the bytes, limited to 10 MB by default.

Waits for completion and saves to the destination using bounded memory.

Types

t()

@type t() :: %Fluffy.Download{
  runtime: pid(),
  source: binary() | PlaywrightEx.Download.t(),
  suggested_filename: String.t(),
  timeout: non_neg_integer() | nil,
  url: String.t()
}

Functions

read!(download, options \\ [])

@spec read!(t(), keyword()) :: binary()

Waits for completion and reads the bytes, limited to 10 MB by default.

save_as!(download, destination)

@spec save_as!(t(), Path.t()) :: :ok

Waits for completion and saves to the destination using bounded memory.