Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobbubu/meta-job-list
https://github.com/jacobbubu/meta-job-list
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jacobbubu/meta-job-list
- Owner: jacobbubu
- License: mit
- Created: 2020-09-26T15:18:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T12:19:09.000Z (over 4 years ago)
- Last Synced: 2024-11-13T16:12:00.765Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# @jacobbubu/meta-job-list
[![Build Status](https://github.com/jacobbubu/meta-job-list/workflows/Build%20and%20Release/badge.svg)](https://github.com/jacobbubu/meta-job-list/actions?query=workflow%3A%22Build+and+Release%22)
[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/meta-job-list/badge.svg)](https://coveralls.io/github/jacobbubu/meta-job-list)
[![npm](https://img.shields.io/npm/v/@jacobbubu/meta-job-list.svg)](https://www.npmjs.com/package/@jacobbubu/meta-job-list/)> Combine JobList and MergedModel to implement a JobList that cleans up jobs based on the number of how many peers been synced.
## Intro.
I use a MergedModel to keep track of how many peers have synced for each job, so I can boldly delete the job.
`MetaJobList` is a class that combine a jobList and a mergedModel that used to store meta data.
`CappedJobList` is more like an example to show how to use `MetaJobList`. it shows how to set a sync threshold. When the number of peers synced to a job reaches this threshold, we delete the job and `applyUpdate` will not accept any further updates to the job.
Please use the [example](./examples/ex1.ts) to understand how this logic works.