Periscope (periscope v0.2.4)

Tools for dealing with liveview processes, components, sockets, assigns. Pulls this information directly from the list of BEAM processes.

Link to this section Summary

Functions

Returns a list of liveview module names. Expect to see stuff like MyApp.CustomerWorkflow or some such name. This does NOT list the names of components. Use components/0 for that.

Returns the sockets for all active liveviews in a 0-indexed map. So all_sockets(0) will return the first socket in the map.

Returns a list of active comoponent names. These are module names, so you only see one per module. Even if one component is rendered many times, you will only see its name once. If you want to see how many instances of a component are rendered. use components/0.

liveview_pids returns the PID of every process running a liveview.

Returns a single socket. By default it's the 0th socket in the map, so if your application has only one liveview running, you just want to call this without arguments. If you have multiple liveview processes, then you'll want to use all_sockets to view the list and grab the one you want using this function.

as socket/1, but for liveview names.

Link to this section Functions

Link to this function

all_liveviews()

Returns a list of liveview module names. Expect to see stuff like MyApp.CustomerWorkflow or some such name. This does NOT list the names of components. Use components/0 for that.

Returns the sockets for all active liveviews in a 0-indexed map. So all_sockets(0) will return the first socket in the map.

Link to this function

assigns_for(component)

Link to this function

component_names()

Returns a list of active comoponent names. These are module names, so you only see one per module. Even if one component is rendered many times, you will only see its name once. If you want to see how many instances of a component are rendered. use components/0.

Link to this function

components_to_assigns()

Link to this function

liveview_pids()

liveview_pids returns the PID of every process running a liveview.

Link to this function

paths_and_liveviews()

Link to this function

paths_and_liveviews(your_app_web)

Link to this function

socket(socket_index \\ 0)

Returns a single socket. By default it's the 0th socket in the map, so if your application has only one liveview running, you just want to call this without arguments. If you have multiple liveview processes, then you'll want to use all_sockets to view the list and grab the one you want using this function.

Link to this function

which_liveview(socket_index \\ 0)

as socket/1, but for liveview names.