content_indexer v0.2.0 ContentIndexer.Services.ListCheckerServer

Summary

ListCheckerServer is the OTP server that uses Genserver to handle the
interactions with the individual workers and the parent caller
The ListCheckerWorkers each process a list of tokens
and checks that list for a given token. Once it is done a message is
returned to the ListCheckerServer.
The server in turn sends a message to the callee - advising it once the whole
list of token lists has been checked successfully!

Basic Useage

The start method is called by a calling parent as well as the start_worker to spawn parallel processing of a large number of token lists

We pass it the size of the list of tokens for a running total and the PID of the calling parent process to whom we pass the completed result back once done

Link to this section Summary

Functions

Initalises a collection - basically a list of tokens that will be used to check whether a token is contained in it

Link to this section Functions

Link to this function count(index, count)
Link to this function current_state()
Link to this function initialise_collection(list_size, parent_pid)

Initalises a collection - basically a list of tokens that will be used to check whether a token is contained in it

## Parameters

- list_size: Integer representing the size of the list
- parent_pid: PID of the process calling this server so we can notify it back

## Example

iex> ContentIndexer.Services.ListCheckerServer.initialise_collection(5, self())
      {:ok, {0, 1, 5, #PID<0.176.0>}}