func (c Cache) CreateTask(ctx context.Context, pluginID string, operationName string, args []*models.PluginArgInput, progress chan float64) (Task, error) {
	serverConnection := c.makeServerConnection(ctx)

	// find the plugin and operation
	plugin := c.getPlugin(pluginID)

	if plugin == nil {
		return nil, fmt.Errorf("no plugin with ID %s", pluginID)
	}

	operation := plugin.getTask(operationName)
	if operation == nil {
		return nil, fmt.Errorf("no task with name %s in plugin %s", operationName, plugin.getName())
	}

	task := pluginTask{
		plugin:       plugin,
		operation:    operation,
		input:        buildPluginInput(plugin, operation, serverConnection, args),
		progress:     progress,
		gqlHandler:   c.gqlHandler,
		serverConfig: c.config,
	}
	return task.createTask(), nil
}
// CreateTask runs the plugin operation for the pluginID and operation
// name provided. Returns an error if the plugin or the operation could not be
// resolved.
CreateTask runs the plugin operation for the pluginID and operation
name provided. Returns an error if the plugin or the operation could not be
resolved.
// CreateTask runs the plugin operation for the pluginID and operation // name provided . Returns an error if the plugin or the operation could not be // resolved .
func (c Cache) CreateTask(ctx context.Context, pluginID string, operationName string, args []*models.PluginArgInput, progress chan float64) (Task, error) {
	serverConnection := c.makeServerConnection(ctx)
	plugin := c.getPlugin(pluginID)
	if plugin == nil {
		return nil, fmt.Errorf("no plugin with ID %s", pluginID)
	}
	operation := plugin.getTask(operationName)
	if operation == nil {
		return nil, fmt.Errorf("no task with name %s in plugin %s", operationName, plugin.getName())
	}
	task := pluginTask{
		plugin:       plugin,
		operation:    operation,
		input:        buildPluginInput(plugin, operation, serverConnection, args),
		progress:     progress,
		gqlHandler:   c.gqlHandler,
		serverConfig: c.config,
	}
	return task.createTask(), nil
}
func ( c Cache ) CreateTask ( ctx context . Context , pluginID string , operationName string , args [ ] * models . PluginArgInput , progress chan float64 ) ( Task , error ) { serverConnection := c . makeServerConnection ( ctx ) plugin := c . getPlugin ( pluginID ) if plugin == nil { return nil , fmt . Errorf ( " " , pluginID ) } operation := plugin . getTask ( operationName ) if operation == nil { return nil , fmt . Errorf ( " " , operationName , plugin . getName ( ) ) } task := pluginTask { plugin : plugin , operation : operation , input : buildPluginInput ( plugin , operation , serverConnection , args ) , progress : progress , gqlHandler : c . gqlHandler , serverConfig : c . config , } return task . createTask ( ) , nil }
CreateTask runs the plugin operation for the pluginID and operation
name provided.
CreateTask runs the plugin operation for the pluginID and operation name provided .
// find the plugin and operation