{"id":21203041,"url":"https://github.com/kvdpxne/thrivi","last_synced_at":"2025-03-14T22:42:00.306Z","repository":{"id":214979344,"uuid":"737814523","full_name":"kvdpxne/thrivi","owner":"kvdpxne","description":"A simple library that allows you to easily and effectively create an event management architecture.","archived":false,"fork":false,"pushed_at":"2024-01-09T17:51:16.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T15:13:21.718Z","etag":null,"topics":["event","event-driven","event-handler","event-listener","java","java-library","library"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvdpxne.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-01-01T15:47:48.000Z","updated_at":"2024-01-06T18:56:54.000Z","dependencies_parsed_at":"2024-01-09T18:29:55.154Z","dependency_job_id":"8937470b-8618-4a09-ba0b-f190efb4a611","html_url":"https://github.com/kvdpxne/thrivi","commit_stats":null,"previous_names":["kvdpxne/thrivi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvdpxne%2Fthrivi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvdpxne%2Fthrivi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvdpxne%2Fthrivi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvdpxne%2Fthrivi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvdpxne","download_url":"https://codeload.github.com/kvdpxne/thrivi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658151,"owners_count":20326464,"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":["event","event-driven","event-handler","event-listener","java","java-library","library"],"created_at":"2024-11-20T20:20:10.737Z","updated_at":"2025-03-14T22:41:59.659Z","avatar_url":"https://github.com/kvdpxne.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\nCreate your own event by extending the ``Event`` or ``CancellableEvent``\nobject if you want your event to be cancelable.\n```java\nimport me.kvdpxne.thrivi.CancellableEvent;\n\npublic class OurEvent extends CancellableEvent {\n\n  private final String projectName;\n\n  public OurEvent(final String projectName) {\n    this.projectName = projectName;\n  }\n\n  public String getProjectName() {\n    return this.projectName;\n  }\n}\n```\n\nCreate a listener for your event or events. It does not matter whether there\nwill be 1 or more event handlers in one object.\n```java\nimport me.kvdpxne.thrivi.EventHandler;\nimport me.kvdpxne.thrivi.EventListener;\n\npublic class OurEventListener implements EventListener {\n\n  // Access modifiers doesn't matter.\n  final EventHandler\u003cOurEvent\u003e ourEventHandler = this.handler(event -\u003e {\n    final String name = event.getProjectName();\n    System.out.printf(\"The name of this project is: %s%n\", name);\n\n    if (name.equals(\"thrivi\")) {\n      System.out.printf(\"Yes, our project name is %s%n\", name);\n    }\n  });\n}\n```\n\nRegister your previously created event and event listener.\n```java\nimport me.kvdpxne.thrivi.BuiltInEventManager;\n\npublic final class Main {\n\n  public static void main(final String[] args) {\n    // 1. Register event.\n    BuiltInEventManager.INSTANCE.addEvent(OurEvent.class);\n\n    // 2. Register event listener.\n    // The easiest way to register the listener of our event in this case will\n    // be to simply initialize the object.\n    new OurEventListener();\n\n    // 3. trigger the registered event whenever and wherever you want.\n    final String[] names = {\n      \"event\",\n      \"event-listener\",\n      \"thrivi\"\n    };\n\n    for (final String name : names) {\n      BuiltInEventManager.INSTANCE.callEvent(new OurEvent(name));\n    }\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvdpxne%2Fthrivi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvdpxne%2Fthrivi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvdpxne%2Fthrivi/lists"}