derhuerst/hafas-generate-gtfs

persistent queue

Open

#1 opened on 2020年3月21日

GitHub で見る
 (6 comments) (0 reactions) (2 assignees)JavaScript (0 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (6 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

A persisting queue will allow the script to fail and/or be cancelled, and resumed later. It will also make hafas-generate-gtfs work in memory-constrained environments, or with very large areas.

Changes necessary:

  1. Specify all tasks (departures fetching, trips fetching) in a JSON-serialisable format. (['fetch-trip', tripId, lineName], etc).
  2. Implement an in-memory store for stops, lines & trips (see API below).
  3. Switch from queue to a persisting one. (I'd like to try bullmq.) Also mention in the readme that Redis is required.

store API

{
	hasStop: async id => Boolean,
	getStop: async id => Stop,
	putStop: async (id, stop) => {},
	// same with lines & trips
}

コントリビューターガイド