Periscope (periscope v0.1.1)

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.

Returns a list of active components. These are component instances, not modules. So if you have e.g. a row component that renders once for each row in a table, expect to see many copies of it here (one for each row).

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

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.

Returns a list of active components. These are component instances, not modules. So if you have e.g. a row component that renders once for each row in a table, expect to see many copies of it here (one for each row).

Link to this function

liveview_pids()

liveview_pids returns the PID of every process running a liveview.

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.