For my GSOC 2020 program, I worked on the Offix Datastore project, a client-side store for JavaScript apps with real-time synchronization over GraphQL. By default, Offix Datastore integrates with Graphback using the GraphQL Crud specification, providing an end-to-end data synchronization solution for JavaScript apps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Router from "koa-router"; | |
export const DEFINITIONS: any = {}; | |
let DEFINITION: any = {}; | |
export function Definition() { | |
return function <T extends { new(...args: any[]): {} }>(constructor: T) { | |
DEFINITIONS[constructor] = { | |
name: constructor.name, | |
type: "object", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JobProcessor { | |
private assignedJobs = new Map<String, any>(); | |
private queue = new Queue<any>(); | |
private nWorkers = 5; | |
async loadOutstandingJobs() { | |
// load 'pending' or 'processing' jobs from DB | |
const jobs = await services.Job | |
.findMany({ | |
$or: [ |