Skip to content

Commit

Permalink
remove web worker bootstrap: don't create workers before they are needed
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Dec 3, 2021
1 parent da5bf31 commit d4a64cf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions src/plugins/transit-demand/TransitSupplyHelper.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,3 @@ class TransitSupplyHelper extends AsyncBackgroundWorker {

// make the typescript compiler happy on import
export default null as any

// bootstrap when worker is loaded
const worker = new TransitSupplyHelper()
5 changes: 1 addition & 4 deletions src/workers/NetworkHelper.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class TransitSupplyHelper extends AsyncBackgroundWorker {

private buildTransitRouteDetails(lineId: string, route: any) {
const allDepartures = route.departures[0].departure
allDepartures.sort(function(a: any, b: any) {
allDepartures.sort(function (a: any, b: any) {
const timeA = a.$.departureTime
const timeB = b.$.departureTime
if (timeA < timeB) return -1
Expand Down Expand Up @@ -238,6 +238,3 @@ class TransitSupplyHelper extends AsyncBackgroundWorker {

// make the typescript compiler happy on import
export default null as any

// bootstrap when worker is loaded
const worker = new TransitSupplyHelper()
3 changes: 0 additions & 3 deletions src/workers/XmlFetcher.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,3 @@ class XmlFetcher extends AsyncBackgroundWorker {

// make the typescript compiler happy on import
export default null as any

// bootstrap when worker is loaded
const worker = new XmlFetcher()

0 comments on commit d4a64cf

Please sign in to comment.