{"id":18259747,"url":"https://github.com/javahippie/clj-groups","last_synced_at":"2025-04-08T23:40:03.959Z","repository":{"id":109639882,"uuid":"83129308","full_name":"javahippie/clj-groups","owner":"javahippie","description":"Attempt in wrapping the JGroups Java library for more idiomatic use in Clojure","archived":false,"fork":false,"pushed_at":"2017-03-13T21:05:16.000Z","size":38,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T22:36:30.419Z","etag":null,"topics":["cluster","distributed-systems","jgroups"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javahippie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-25T12:10:09.000Z","updated_at":"2018-03-06T02:17:58.000Z","dependencies_parsed_at":"2023-03-11T07:46:28.807Z","dependency_job_id":null,"html_url":"https://github.com/javahippie/clj-groups","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javahippie%2Fclj-groups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javahippie%2Fclj-groups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javahippie%2Fclj-groups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javahippie%2Fclj-groups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javahippie","download_url":"https://codeload.github.com/javahippie/clj-groups/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947823,"owners_count":21023058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","distributed-systems","jgroups"],"created_at":"2024-11-05T10:39:45.655Z","updated_at":"2025-04-08T23:40:03.944Z","avatar_url":"https://github.com/javahippie.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# clj-groups\n\n[![Build Status](https://travis-ci.org/javahippie/clj-groups.svg?branch=master)](https://travis-ci.org/javahippie/clj-groups)\n[![Stories in Ready](https://badge.waffle.io/javahippie/clj-groups.png?label=ready\u0026title=Ready)](https://waffle.io/javahippie/clj-groups)\n\nThis Clojure library should serve as an idiomatic wrapper around the great JGroups 4.0.0 Java library from Bela Ban. As a feature-complete wrapper is a challenging project and time is short on our hands, this is not complete, yet.\n\n## Shortcomings\nWe are not there, yet. If you would like to work with us on this project, just send a short message, we are happy about any help, with any skilllevel. \nFor now, you can create channels which will cluster automatically with other channels. You can not pass custom settings into the channel, this is planned for version 0.1.0.\n\n## Usage\n### Create channels\nIt is possible to create multiple channels, which are identified by keywords. As JGroups works with callbacks, you need to provide these callback functions upon creation of the channel in a map: \n\n```clojure\n(clj-groups.channel/connect! \"channel-id\"\n\t\t\t\t\t\t\t {:receive (fn [msg] (println msg)}\n```\nYou only need to specify the callbacks that you really want to use. Below is an example with all possible callbacks specified.\n\n```clojure\n(def callbacks\n  {:receive \n  \t(fn [msg] (println msg) )\n   :get-state \n   \t(fn [output] (println output)\n   :set-state \n   \t(fn [input] (println input)\n   :view-accepted \n   \t(fn [view] (println view))\n   :suspect \n   \t(fn [mbr] (println mbr))\n   :block \n   \t(fn [] (println \"Block\")) \n   :unblock \n   \t(fn [] (println \"Unblock\"))})\n   \n(clj-groups.channel/connect! \"channel-id\"\n\t\t\t\t\t\t  \t callbacks)\n```\nThis will create a channel which is returned by the function. It can be accessed in further operations via the given identifier.\n\n### Send messages\nOne of these operations is sending messages:\n\n```clojure\n(let [chnl (clj-groups.channel/connect! \"test-channel\" \n                                        callbacks)]\n    (clj-groups.channel/send-message! chnl \n                                      {:target nil\n                                       :message \"Heyoo\"}))\n```\nThis will propagate the message to the participiants of the cluster 'test-channel'. It will be processed inside the `receive` callback.\n\n### Close channels\nChannels can also be closed, to detach your application from the cluster. \n\n```clojure\n(clj-groups.channel/close! channel)\n```\n\nThis will close the channel.\n\n\n\n## License\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavahippie%2Fclj-groups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavahippie%2Fclj-groups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavahippie%2Fclj-groups/lists"}