Skip to content

Commit

Permalink
WIP #1186 ensure compute backends can be loaded synchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Sep 18, 2019
1 parent 9f4ec7c commit f4de4e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/execution/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
/*globals define, requirejs */
const COMPUTE_BACKENDS = ['gme', 'local'];

define([
'underscore',
'module',
], function(
'module'
].concat(COMPUTE_BACKENDS.map(name => `deepforge/execution/backends/${name}/index`)),
function(
_,
module
) {
const Execution = {};
const BACKENDS = ['gme', 'local'];

Execution.getBackend = function(name) {
name = name.toLowerCase();
if (!BACKENDS.includes(name)) {
if (!COMPUTE_BACKENDS.includes(name)) {
throw new Error(`Execution backend not found: ${name}`);
}

Expand Down

0 comments on commit f4de4e5

Please sign in to comment.