Skip to content

Elixir module that provides user presence tracking functionality for Livebook applications.

License

Notifications You must be signed in to change notification settings

elepedus/kino_user_presence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Real-time user presence tracking
  • Customizable join and leave callbacks
  • Heartbeat mechanism to detect inactive users

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:

  • Heartbeat interval: 100 milliseconds
  • Grace period: 3 heartbeat intervals

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.

About

Elixir module that provides user presence tracking functionality for Livebook applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages