{"id":19075822,"url":"https://github.com/xenoken/hermes","last_synced_at":"2026-05-20T07:30:17.358Z","repository":{"id":56832047,"uuid":"194718457","full_name":"xenoken/hermes","owner":"xenoken","description":"Powerful PubSub Messaging for Dart","archived":false,"fork":false,"pushed_at":"2019-08-01T15:33:16.000Z","size":14,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T18:17:24.977Z","etag":null,"topics":["dart","dartlang","eventbus","events","messaging","pubsub"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xenoken.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-01T17:49:26.000Z","updated_at":"2019-09-14T15:51:21.000Z","dependencies_parsed_at":"2022-09-07T16:03:09.008Z","dependency_job_id":null,"html_url":"https://github.com/xenoken/hermes","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/xenoken%2Fhermes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenoken%2Fhermes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenoken%2Fhermes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xenoken%2Fhermes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xenoken","download_url":"https://codeload.github.com/xenoken/hermes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240127089,"owners_count":19751938,"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":["dart","dartlang","eventbus","events","messaging","pubsub"],"created_at":"2024-11-09T01:56:06.088Z","updated_at":"2026-05-20T07:30:17.316Z","avatar_url":"https://github.com/xenoken.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"Messaging library for Dart. Nimble and efficient like the messenger of the Gods.\n\n# What is it\n\nHermes is a simple but powerful way to send and receive messages across a Dart App.\nFor those who are experienced Publish/subscribe messaging and event subscriptions, Hermes's mechanism will look very familiar.\nOne cool thing about Hermes is the ability to setup a pub\\sub architecture with only *two lines* of code.\nDivine.\n\nHermes encapsulates the idea of event or signal (concept found in other messaging or eventing systems)\nwith the loose concept of Message.\n\nYou can send a message from any position in your code. Hermes handles the task of carrying the message to all recipients that\nare waiting for the message.\n\nIn the same way you can send a Message from anywhere, You are able to receive a message sent from anywhere too.\n\nFor Hermes any object can act as a Message. Primitives, Functions, Built-in Types, Custom Types...*Anything*.\n\nHermes doesn't have the concept of registration. Everything is handled transparently. The moment your code wants to fetch a message, it automatically registers itself to receive it.\n\n\n## How to Use it\n\nTo send a message just call the _send_ function.\n```dart\nHermes.send\u003cT\u003e(message);\n// or\nHermes.send(T message);\n```\n\nTo receive a message just call the _fetch_ function.\n```dart\nHermes.fetch\u003cT\u003e(message, (T message){ });\n// or\nHermes.fetch(T message, (T message){ });\n```\n\nNote that _fetch_ acts like a transparent registration mechanism: when You call _fetch_ the specified handler function will be called whenever a new message of type T arrives.\n\nFrom version 3.0.0 _fetch_ returns a FetchOperation instance. this object can be used to 'unfetch' and release resources:\n```dart\nHermes.unfetch(FetchOperation op);\n```\n\n\nA simple usage example:\n\n```dart\nimport 'package:hermes/hermes.dart';\n\nclass Message {\n  final String content;\n  Message(this.content);\n}\n\nmain() {\n  // registers a callback that is called when the message is received.\n  var fetchOp = Hermes.fetch((Message message) {\n    print(\"Message received. it says: '${message.content}'\");\n  });\n\n  // send a message\n  Hermes.send(Message(\"Hello World!\"));\n  \n  // ... some code here...\n  \n  // unfetch the message if not required anymore.\n  Hermes.unfetch(fetchOp);\n}\n\n```\n\n## Remarks\n\n- _Hermes.send_ and _Hermes.fetch_ are synchronous functions, but the message handler can be async.\n- _Hermes.unfetch_ is an async function.\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: http://www.github.com/xenoken/hermes/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxenoken%2Fhermes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxenoken%2Fhermes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxenoken%2Fhermes/lists"}