pushex v0.0.3 Pushex.Sandbox
Sandbox where notifications get saved when the application is running in sandbox mode.
This is meant to be used in tests, and should not be used in production.
Note that all operations are dependent on the pid
, so the process
calling and Pushex.send_notification/2
and the process calling Pushex.Sandbox.list_notifications/1
must be the same, or the pid
should be passed explicitly otherwise.
Summary
Functions
Clear all the recorded notifications
List recorded notifications keeping their order of arrival
Records the notification. This is used by Pushex.ResponseHandler.Sandbox
to record
requests and responses
Wait until a notification arrives
Functions
Specs
clear_notifications([{:pid, pid}]) :: :ok
Clear all the recorded notifications.
Specs
list_notifications([{:pid, pid}]) :: [{Pushex.GCM.response, Pushex.GCM.request, {pid, reference}}]
List recorded notifications keeping their order of arrival.
Specs
record_notification(Pushex.GCM.response, Pushex.GCM.request, {pid, reference}) :: :ok
Records the notification. This is used by Pushex.ResponseHandler.Sandbox
to record
requests and responses.
Specs
wait_notifications(pid: pid, timeout: non_neg_integer, count: non_neg_integer) :: [{Pushex.GCM.response, Pushex.GCM.request, {pid, reference}}]
Wait until a notification arrives.