{"id":18032479,"url":"https://github.com/debjitbis08/actorpubsub","last_synced_at":"2025-07-16T22:32:08.872Z","repository":{"id":8690686,"uuid":"10353011","full_name":"debjitbis08/actorPubSub","owner":"debjitbis08","description":"A publish/subscribe library for JavaScript based on Actor Model.","archived":false,"fork":false,"pushed_at":"2014-07-28T21:19:36.000Z","size":216,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T20:14:50.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debjitbis08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-29T06:05:09.000Z","updated_at":"2017-02-10T03:39:13.000Z","dependencies_parsed_at":"2022-08-30T16:11:04.788Z","dependency_job_id":null,"html_url":"https://github.com/debjitbis08/actorPubSub","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/debjitbis08%2FactorPubSub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debjitbis08%2FactorPubSub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debjitbis08%2FactorPubSub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debjitbis08%2FactorPubSub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debjitbis08","download_url":"https://codeload.github.com/debjitbis08/actorPubSub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256115,"owners_count":20909240,"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":[],"created_at":"2024-10-30T10:13:34.797Z","updated_at":"2025-04-04T22:10:01.614Z","avatar_url":"https://github.com/debjitbis08.png","language":"JavaScript","readme":"# ActorPubSub [![Build Status](https://travis-ci.org/debjitbis08/actorPubSub.png?branch=master)](https://travis-ci.org/debjitbis08/actorPubSub)\n\nActorPubSub is a dependency free publish/subscribe library for JavaScript based on the Actor Model. It takes a lot of \ninspiration from [PubSubJS](https://github.com/mroderick/PubSubJS) and uses the ideas from \n[Actors Make Better Observers](http://www.dalnefre.com/wp/2011/05/actors-make-better-observers/) to implement the \nrequired actors. It can be used as a normal pub/sub library as all the actor logic is hidden away.\n\nA major benefit of this implementation is that observer list updates do not block the notification process.\n\n## Features\n* Dependency free.\n* Synchronization decoupling.\n* Attaching and detaching subscribers is also asynchronous.\n* Since observer list updates are asynchronous, notify operations are possible while updates are in progress.\n* Data passed to subscribers is a copy of the original data, thus, changes to it by the subscribers does not \n  affect other subscribers and the publisher.\n\n## Examples\n\n### Basic Example\n\n```javascript\nvar subscriberCb = function (msg, data) {\n\tconsole.log(msg, data);\n};\n\nvar token = PubSub.subscribe('Topic', subscriberCb);\n\nPubSub.publish('Topic', 'ahoy!');\n```\n### Cancel specific subscription\n\n```javascript\n// create a function to receive the topic\nvar mySubscriber = function( msg, data ){\n    console.log(msg, data);\n};\n\n// add the function to the list of subscribers to a particular topic\n// we're keeping the returned token, in order to be able to unsubscribe\n// from the topic later on\nvar token = PubSub.subscribe('MY TOPIC', mySubscriber);\n\n// unsubscribe this subscriber from this topic\nPubSub.unsubscribe('MY TOPIC', token);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebjitbis08%2Factorpubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebjitbis08%2Factorpubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebjitbis08%2Factorpubsub/lists"}