{"id":23377952,"url":"https://github.com/beyondjs/dynamic-processor","last_synced_at":"2026-02-03T08:02:58.263Z","repository":{"id":64057368,"uuid":"572994604","full_name":"beyondjs/dynamic-processor","owner":"beyondjs","description":"A specialized JS utility for handling asynchronous processing with synchronous data access. Manages state updates, invalidation, and change notifications, making it ideal for complex data processing scenarios in BeyondJS applications. It provides a robust solution for managing asynchronous operations while allowing synchronous data consumption.","archived":false,"fork":false,"pushed_at":"2025-08-10T20:21:20.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-14T17:19:15.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/beyondjs.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,"zenodo":null}},"created_at":"2022-12-01T13:29:03.000Z","updated_at":"2025-01-07T14:08:27.000Z","dependencies_parsed_at":"2025-01-02T11:23:57.381Z","dependency_job_id":"f1f4356e-8433-4f1e-b8ff-1e3f81e744b7","html_url":"https://github.com/beyondjs/dynamic-processor","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"71d7591a7fd097d502798ae172c2857877d41784"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beyondjs/dynamic-processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fdynamic-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fdynamic-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fdynamic-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fdynamic-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beyondjs","download_url":"https://codeload.github.com/beyondjs/dynamic-processor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beyondjs%2Fdynamic-processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29037748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T06:39:36.383Z","status":"ssl_error","status_checked_at":"2026-02-03T06:39:32.787Z","response_time":96,"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":[],"created_at":"2024-12-21T18:33:34.556Z","updated_at":"2026-02-03T08:02:58.244Z","avatar_url":"https://github.com/beyondjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @beyond-js/dynamic-processor\n\n## Introduction\n\nThe context on which the DynamicProcessor is designed, is when there is an asynchronous processing, and where you want\nto access the processed data synchronously, once the asynchronous processing has finished.\n\nThe general logic of the processor is that it starts in an inactive state, and once started, it is kept up-to-date by\nprocessing each time it is invalidated and as long as it has already been started. As the consumption of the\nDynamicProcessor data is synchronous, the data must be consumed after waiting for the .ready promise, or after receiving\nchange notifications ('change' event). The 'change' event guarantees that the data has already been previously\nprocessed.\n\n## Processor usage is as follows:\n\n1- Access the .ready property\n\n-   await processor.ready;\n\n2- Listen for changes\n\n-   processor.on ('change', listener);\n\n## Characteristics\n\n-   The processor does not execute processing until it is initialized.\n-   If the .ready property (await processor.ready) is accessed, the processor is initialized, therefore processing is\n    executed.\n-   If the processor is invalidated, and it has already been initialized, then the .process method is executed\n    automatically.\n-   It emits change events every time it is processed again, starting from the second processing. The first processing\n    is considered the initial state, and each additional processing, a change of the state of the processor.\n\n## Considerations\n\n-   The initialise() method internally calls the \\_process() method. The processor is considered initialized when it has\n    already been processed for the first time.\n\n## Problems that DynamicProcessor solves\n\n-   Invalidating the object (execute .\\_invalidate()) implies reprocessing it, but only if it has already been\n    initialized.\n-   The \\_process (request) method receives the request parameter that allows, after executing any asynchronous\n    function, to verify if it should continue processing or cancel the execution.\n\n```\n_process(request) {\n  await asyncMethod ();\n  if (this._request! == request) return; // Cancel execution\n}\n```\n\n-   If the object is invalidated while processing, DynamicProcessor rerun the \\_process method automatically.\n\n## License\n\nMIT © [[BeyondJS](https://beyondjs.com)]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondjs%2Fdynamic-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeyondjs%2Fdynamic-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeyondjs%2Fdynamic-processor/lists"}