{"id":24021181,"url":"https://github.com/zipcodecore/threadseventhandler","last_synced_at":"2025-04-15T21:16:04.236Z","repository":{"id":45568560,"uuid":"158262621","full_name":"ZipCodeCore/ThreadsEventHandler","owner":"ZipCodeCore","description":"Lab to demonstrate threads using streams ","archived":false,"fork":false,"pushed_at":"2021-12-08T02:52:26.000Z","size":3,"stargazers_count":0,"open_issues_count":1,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T21:15:56.017Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/ZipCodeCore.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":"2018-11-19T17:09:36.000Z","updated_at":"2022-02-03T16:41:05.000Z","dependencies_parsed_at":"2022-08-03T04:30:21.804Z","dependency_job_id":null,"html_url":"https://github.com/ZipCodeCore/ThreadsEventHandler","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FThreadsEventHandler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FThreadsEventHandler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FThreadsEventHandler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FThreadsEventHandler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/ThreadsEventHandler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249153950,"owners_count":21221330,"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":"2025-01-08T12:39:44.870Z","updated_at":"2025-04-15T21:16:04.218Z","avatar_url":"https://github.com/ZipCodeCore.png","language":"Java","readme":"# Threading Event Handlers\n\nThe main class of this project starts up two threads using a stream of Event Listeners. It then creates a stream of input to the console\n\nEvery time a message is sent in, an event is pushed to the Event Tracker Singleton. The tracker will keep track of messages sent in. If a message has a Listener associated with it, there should be a response printed to the console\n\n### Event Tracker\n\n* Singleton class that is synchronized between threads\n* Implements the Tracker interface\n* Should store the number of times a string has been sent into it\n* Push should increment the integer associated to the string passed in\n* Has should return true if there is an integer asssociated with the string passed in and if the integer is greater than 0\n* handle should take in an event handler. After running the event handler's handle function it should decrement the integer associated with the message passed in.\n* Handle should be the only way to decrement an integer in the map\n\n### Event Listener\n\n* Extends Thread\n* Takes in a message to listen for and a reply to respond with\n* Optionally can take in a custom tracker. Defaults to the EventTracker singleton class\n* The run method should use a while loop that continues to run as long as \"readyToQuit\" returns false\n* ready to quit should return true if there is a \"quit\" event in the event tracker\n* The should reply method should return true if the event tracker has a message the listener is listening for\n* In the while loop, if should reply returns true, the Tracker should have its \"handle\" method called passing in an instance of EventHandler. The Handler should print out the reply","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fthreadseventhandler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Fthreadseventhandler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fthreadseventhandler/lists"}