{"id":13515286,"url":"https://github.com/mooziii/alert","last_synced_at":"2026-01-23T06:00:52.114Z","repository":{"id":42190004,"uuid":"475878501","full_name":"mooziii/alert","owner":"mooziii","description":"🚨Alert is a really simple and blazing fast event listening api","archived":false,"fork":false,"pushed_at":"2023-05-05T15:50:09.000Z","size":116,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T04:36:46.515Z","etag":null,"topics":["events","listening"],"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/mooziii.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-30T12:54:57.000Z","updated_at":"2024-09-06T18:39:44.000Z","dependencies_parsed_at":"2024-11-01T19:31:35.934Z","dependency_job_id":"b177ae8c-5276-44f0-9c1f-baad9fcd9019","html_url":"https://github.com/mooziii/alert","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mooziii/alert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooziii%2Falert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooziii%2Falert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooziii%2Falert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooziii%2Falert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mooziii","download_url":"https://codeload.github.com/mooziii/alert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooziii%2Falert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28681696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["events","listening"],"created_at":"2024-08-01T05:01:08.873Z","updated_at":"2026-01-23T06:00:52.040Z","avatar_url":"https://github.com/mooziii.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# 🚨 alert\n\nAlert is a really simple, easy to use and blazing fast event listening utility. \n\n## Tutorial\n\n### Add the dependency\n\nThe project is available on maven central.\nJust add the dependency like this:\n\n#### Gradle (Kotlin)\n\n```kotlin\nimplementation(\"me.obsilabor:alert:1.0.8\")\n```\n\n#### Gradle (Groovy)\n\n```groovy\nimplementation 'me.obsilabor:alert:1.0.8'\n```\n*To shade the dependency into your jar, you probably want to use the shadow gradle plugin*\n\n#### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eme.obsilabor\u003c/groupId\u003e\n    \u003cartifactId\u003ealert\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.8\u003c/version\u003e\n\u003c/dependency\u003e\n```\n*For maven you probably have to use any plugin that does the same as shadow, I have no idea how maven works*\n\n\u003cdetails\u003e\n    \u003csummary\u003eKotlin Tutorial\u003c/summary\u003e\n\n### Create a event\n\nCreate a event by extending from `Event` (or if the event should be cancellable extend from `Cancellable`)\n\nExample:\n\n```kotlin\nclass RabbitJumpEvent(val rabbit: Rabbit) : Cancellable() {}\n```\n\nTrigger the event using `EventManager.callEvent`. If you want to procces the event e.g. if it can be cancelled, you must store the event as a variable.\n\nExample:\n\n```kotlin\nfun handleRabbitJumping(rabbit: Rabbit) {\n    val event = EventManager.callEvent(RabbitJumpEvent(this))\n    if(event.isCancelled) {\n        return\n    }\n    rabbit.jump()\n}\n```\n\n### Listen to a event\n\nCreate a listener just by creating a new class and in the init method, you can use the listen function just like in this example:\n\n```kotlin\nclass RabbitJumpListener {\n    \n    init {\n        subscribeToEvent\u003cRabbitJumpEvent\u003e {\n            //TODO: Do something cool :)\n        }\n    }\n}\n```\n\n*To prioritize subscriptions, you can change the priority parameter.*\n\n```kotlin\nclass RabbitJumpListener {\n\n    init {\n        subscribeToEvent\u003cRabbitJumpEvent\u003e(priority = EventPriority.HIGHEST) {\n            //TODO: Do something cool :)\n        }\n    }\n}\n\n```\n\nTriggering events in kotlin is just the same as in java\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n    \u003csummary\u003eJava Tutorial\u003c/summary\u003e\n\n### Create a event\n\nCreate a event by extending from `Event` (or if the event should be cancellable extend from `Cancellable`)\n\nExample:\n\n```java\npublic class RabbitJumpEvent extends Cancellable {\n    \n    private final Rabbit rabbit;\n    \n    public RabbitJumpEvent(Rabbit rabbit) {\n        this.rabbit = rabbit;\n    }\n    \n    public Rabbit getRabbit() {\n        return this.rabbit;\n    }\n}\n```\n\nTrigger the event using `EventManager.callEvent`. If you want to procces the event e.g. if it can be cancelled, you must store the event as a variable.\n\nExample:\n\n```java\npublic void handleRabbitJumping(Rabbit rabbit) {\n    RabbitJumpEvent event = EventManager.callEvent(event);\n    if(event.isCancelled()) {\n        return;    \n    }\n    rabbit.jump();\n}\n```\n\n### Listen to a event\n\nCreate a listener just by creating a new class and a method annotated with @Subscribe. Add the event you want to listen to as an parameter.\n\n```java\npublic class RabbitJumpListener {\n    \n    @Subscribe\n    public void onRabbitJump(RabbitJumpEvent event) {\n        //TODO: Do something cool :)\n    }\n}\n```\n\n*To prioritize subscriptions, just set the priority value of the @Subscribe annotation*\n\n```java\npublic class RabbitJumpListener {\n    \n    @Subscribe(priority = EventPriority.HIGHEST)\n    public void onRabbitJump(RabbitJumpEvent event) {\n        //TODO: Do something cool :)\n    }\n}\n```\n\u003c/details\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooziii%2Falert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooziii%2Falert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooziii%2Falert/lists"}