Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a sample on how to use the Poller? #1

Open
chgeuer opened this issue Nov 26, 2024 · 0 comments
Open

Is there a sample on how to use the Poller? #1

chgeuer opened this issue Nov 26, 2024 · 0 comments

Comments

@chgeuer
Copy link

chgeuer commented Nov 26, 2024

Hi @reachfh,

is there a sample on how to use the Poller? I try to understand how the callback module needs to look like, and how the Poller can be started...

This here ain't right?

defmodule X do
  def init(args) do
    IO.inspect({:init, args})
    {:ok, args}
  end
  def get_csr(domain) do
    IO.inspect({:get_csr, domain})
    {:ok, nil}
  end
  def process_certificate(order, certificate) do
    IO.inspect({:process_certificate, order, certificate})
    :ok
  end
  def ack_order(order) do
    IO.inspect({:ack_order, order})
  end
  def invalid_order(order) do
    IO.inspect({:invalid_order, order})
  end
  def handle_finalization_error(order, error) do
    IO.inspect({:handle_finalization_error, order, error})
  end
  def publish_challenge_responses(responses) do
    IO.inspect({:publish_challenge_responses, responses})
  end
end

{:ok, poller_pid} = AcmeClient.Poller.start_link(
  %{
    session: session, 
    identifiers: ["foo.contoso.com"],
    cb_mod: X 
  }
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant