Git Product home page Git Product logo

Comments (4)

okeuday avatar okeuday commented on August 23, 2024

I added support for this, however, the callback function arguments are reversed as: handle_join(Group :: any(), Pid :: pid()) -> any(). The other difference is that currently the join and leave callbacks will be called for anything that causes the pid to join or leave. Instead of having separate callbacks for separate reasons, I would rather add a Reason argument to differentiate between: join_local, join_remote, leave_local, leave_remote, and exit (I could probably add the reason for the exit too). The additional Reason argument could be optional.

from cpg.

blt avatar blt commented on August 23, 2024

I like the reason argument approach.

from cpg.

okeuday avatar okeuday commented on August 23, 2024

I added the reason argument, so that the callback can be either: handle_join(Group :: any(), Pid :: pid()) -> any() or handle_join(Group :: any(), Pid :: pid(), join_local | join_remote | {exit, any()}) -> any() as shown in the cpg:callback_join() type (with the same equivalent for leave). The join_local or join_remote difference shows where the join is originating from (so the pid may still be a local pid with a join_remote if the state is being updated from a remote node and relates to a local pid (not common, but a possible edge-case)). The other thing to keep in-mind is that the callback is called for each instance of the Pid in the Group, so if you join the same pid multiple times, the callback will be called the same number of times.

from cpg.

okeuday avatar okeuday commented on August 23, 2024

There was also a bug previously with the node monitoring, but that has been fixed (it was from a feature that was recently added in the v1.3.1.1 tag) and the code has been tagged. The new tag is v1.3.1.3.

from cpg.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.