KinoUserPresence

KinoUserPresence is an Elixir module that provides user presence tracking functionality for Livebook applications. It monitors user connections, tracks activity through heartbeats, and executes callbacks when users join or leave.

Features

Installation

Add kino_user_presence to your list of dependencies in mix.exs:

Mix.install(
  [
    {:kino_user_presence, "~> 0.1.0"}
  ]
  )

Usage

To use KinoUserPresence in your Livebook application:

Import the module:

KinoUserPresence.listen(
    fn origin -> IO.puts("#{origin} joined") end,
    fn origin -> IO.puts("#{origin} left") end
)

Configuration

The module uses the following default configuration:

You can modify these values by changing the module attributes in the source code.

Development

To set up the project for development:

  1. Clone the repository
  2. Run mix deps.get to fetch dependencies
  3. Run mix test to execute the test suite

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache License - see the LICENSE file for details.