diff --git a/TestEventHandlerWithFailureContext.html b/TestEventHandlerWithFailureContext.html index 04a6ce7e2b..75bb33fc01 100644 --- a/TestEventHandlerWithFailureContext.html +++ b/TestEventHandlerWithFailureContext.html @@ -217,9 +217,9 @@
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
iex> change_ability(ability)
-%Ecto.Changeset{data: %Ability{}}
+iex> change_ability(ability)
+%Ecto.Changeset{data: %Ability{}}
iex> create_ability(%{field: value})
-{:ok, %Ability{}}
+iex> create_ability(%{field: value})
+{:ok, %Ability{}}
-iex> create_ability(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_ability(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
iex> delete_ability(ability)
-{:ok, %Ability{}}
+iex> delete_ability(ability)
+{:ok, %Ability{}}
-iex> delete_ability(ability)
-{:error, %Ecto.Changeset{}}
+iex> delete_ability(ability)
+{:error, %Ecto.Changeset{}}
iex> get_ability!(123)
-%Ability{}
+iex> get_ability!(123)
+%Ability{}
-iex> get_ability!(456)
+iex> get_ability!(456)
** (Ecto.NoResultsError)
iex> list_abilities()
-[%Ability{}, ...]
+iex> list_abilities()
+[%Ability{}, ...]
iex> update_ability(ability, %{field: new_value})
-{:ok, %Ability{}}
+iex> update_ability(ability, %{field: new_value})
+{:ok, %Ability{}}
-iex> update_ability(ability, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_ability(ability, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
A helper that transforms changeset errors into a map of messages.
assert {:error, changeset} = Accounts.create_user(%{password: "short"})
-assert "password is too short" in errors_on(changeset).password
-assert %{password: ["password is too short"]} = errors_on(changeset)
+A helper that transforms changeset errors into a map of messages.
assert {:error, changeset} = Accounts.create_user(%{password: "short"})
+assert "password is too short" in errors_on(changeset).password
+assert %{password: ["password is too short"]} = errors_on(changeset)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleProcessManager, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleProcessManager, []}
+], strategy: :one_for_one)
Supervisor.start_link([
- {ExampleHandler, []}
-], strategy: :one_for_one)
+Supervisor.start_link([
+ {ExampleHandler, []}
+], strategy: :one_for_one)
Defines a quantum Scheduler.
When used, the quantum scheduler expects the :otp_app
as option.
The :otp_app
should point to an OTP application that has
-the quantum runner configuration. For example, the quantum scheduler:
defmodule Trento.Scheduler do
+the quantum runner configuration. For example, the quantum scheduler:defmodule Trento.Scheduler do
use Quantum, otp_app: :trento
-end
Could be configured with:
config :trento, Trento.Scheduler,
- jobs: [
- {"@daily", {Backup, :backup, []}},
- ]
+
end
Could be configured with:
config :trento, Trento.Scheduler,
+ jobs: [
+ {"@daily", {Backup, :backup, []}},
+ ]
iex(1)> :telemetry_registry.discover_all(:quantum)
+iex(1)> :telemetry_registry.discover_all(:quantum)
:ok
-iex(2)> :telemetry_registry.spannable_events()
-[{[:quantum, :job], [:start, :stop, :exception]}]
+iex(2)> :telemetry_registry.spannable_events()
+[{[:quantum, :job], [:start, :stop, :exception]}]
iex(3)> :telemetry_registry.list_events
-[
- {[:quantum, :job, :add], Quantum,
- %{
+[
+ {[:quantum, :job, :add], Quantum,
+ %{
description: "dispatched when a job is added",
measurements: "%{}",
metadata: "%{job: Quantum.Job.t(), scheduler: atom()}"
- }},
- {[:quantum, :job, :delete], Quantum,
- %{
+ }},
+ {[:quantum, :job, :delete], Quantum,
+ %{
description: "dispatched when a job is deleted",
measurements: "%{}",
metadata: "%{job: Quantum.Job.t(), scheduler: atom()}"
- }},
- {[:quantum, :job, :exception], Quantum,
- %{
+ }},
+ {[:quantum, :job, :exception], Quantum,
+ %{
description: "dispatched on job execution fail",
measurements: "%{duration: integer()}",
metadata: "%{telemetry_span_context: term(), job: Quantum.Job.t(), node: Node.t(), scheduler: atom(), kind: :throw | :error | :exit, reason: term(), stacktrace: list()}"
- }},
- {[:quantum, :job, :start], Quantum,
- %{
+ }},
+ {[:quantum, :job, :start], Quantum,
+ %{
description: "dispatched on job execution start",
measurements: "%{system_time: integer()}",
metadata: "%{telemetry_span_context: term(), job: Quantum.Job.t(), node: Node.t(), scheduler: atom()}"
- }},
- {[:quantum, :job, :stop], Quantum,
- %{
+ }},
+ {[:quantum, :job, :stop], Quantum,
+ %{
description: "dispatched on job execution end",
measurements: "%{duration: integer()}",
metadata: "%{telemetry_span_context: term(), job: Quantum.Job.t(), node: Node.t(), scheduler: atom(), result: term()}"
- }},
- {[:quantum, :job, :update], Quantum,
- %{
+ }},
+ {[:quantum, :job, :update], Quantum,
+ %{
description: "dispatched when a job is updated",
measurements: "%{}",
metadata: "%{job: Quantum.Job.t(), scheduler: atom()}"
- }}
-]
+ }}
+]
import TrentoWeb.Gettext
# Simple translation
-gettext("Here is the string to translate")
+gettext("Here is the string to translate")
# Plural translation
-ngettext("Here is the string to translate",
+ngettext("Here is the string to translate",
"Here are the strings to translate",
- 3)
+ 3)
# Domain-based translation
-dgettext("errors", "Here is the error message to translate")
See the Gettext Docs for detailed usage.
+dgettext("errors", "Here is the error message to translate")See the Gettext Docs for detailed usage.
asdf allows to use specific versions of programming language tools that are known to be compatible with the project, rather than relying on the version that's installed globally on the host system.
In order to use asdf, follow the official asdf getting started guide.
Install all required asdf plugins from .tool-versions inside the web repository.
cut -d' ' -f1 .tool-versions|xargs -i asdf plugin add {}
Set up the asdf environment
asdf install
asdf allows to use specific versions of programming language tools that are known to be compatible with the project, rather than relying on the version that's installed globally on the host system.
In order to use asdf, follow the official asdf getting started guide.
Install all required asdf plugins from .tool-versions inside the web repository.
cut -d' ' -f1 .tool-versions|xargs -i asdf plugin add {}
Set up the asdf environment
asdf install