Skip to content

AlgoRegistry.InstallAsync

method · AlgoRegistry · cAlgo.API Since 5.1

Installs an algo file from provided URI asynchrounsly.

Overloads

InstallAsync(string filePath)

Installs an algo file from provided URI asynchrounsly.

DesktopCLICloud

Environment behaviour

Cloud — not supported. Returned operation never completes. A second InstallAsync call in the same instance throws ArgumentException (duplicate key).

InstallationOperation InstallAsync(string filePath)
api.AlgoRegistry.InstallAsync(filePath: str) -> InstallationOperation

Parameters

Name C# type Python type Description
filePath string str Algo file full file path.

Returns InstallationOperation — InstallationOperation

Examples

var operation = AlgoRegistry.InstallAsync(@"C:\Algos\Sample cBot.algo");
Print("Installation started, executing: {0}", operation.IsExecuting);
operation = api.AlgoRegistry.InstallAsync(r"C:\Algos\Sample cBot.algo")
api.Print(f"Installation started, executing: {operation.IsExecuting}")

InstallAsync(string filePath, Action<InstallationResult> callback)

Installs an algo file from provided URI asynchrounsly.

DesktopCLICloud

Environment behaviour

Cloud — not supported. Callback is never called and the operation never completes. A second InstallAsync call throws ArgumentException (duplicate key).

InstallationOperation InstallAsync(string filePath, Action<InstallationResult> callback)
api.AlgoRegistry.InstallAsync(filePath: str, callback: Callable[[InstallationResult], None]) -> InstallationOperation

Parameters

Name C# type Python type Description
filePath string str Algo file full file path.
callback Action<InstallationResult> Callable[[InstallationResult], None] Callback that will be invoked with installation result.

Returns InstallationOperation — InstallationOperation

Examples

AlgoRegistry.InstallAsync(@"C:\Algos\Sample cBot.algo", result =>
{
    if (result.Succeeded)
        Print("Algo installed");
    else
        Print("Installation failed: {0}", result.Error);
});
api.AlgoRegistry.InstallAsync(r"C:\Algos\Sample cBot.algo", lambda result: api.Print(f"Installed: {result.Succeeded} | Error: {result.Error}"))

InstallAsync(Uri uri)

Installs an algo file from provided URI asynchrounsly.

DesktopCLICloud

Environment behaviour

Cloud — not supported. Returned operation never completes. A second InstallAsync call in the same instance throws ArgumentException (duplicate key).

InstallationOperation InstallAsync(Uri uri)
api.AlgoRegistry.InstallAsync(uri: Uri) -> InstallationOperation

Parameters

Name C# type Python type Description
uri Uri Uri Algo file URI.

Returns InstallationOperation — InstallationOperation

Examples

var operation = AlgoRegistry.InstallAsync(new Uri("https://example.com/algos/SampleBot.algo"));
Print("Download and installation started, executing: {0}", operation.IsExecuting);
from System import Uri

operation = api.AlgoRegistry.InstallAsync(Uri("https://example.com/algos/SampleBot.algo"))
api.Print(f"Download and installation started, executing: {operation.IsExecuting}")

InstallAsync(Uri uri, Action<InstallationResult> callback)

Installs an algo file from provided URI asynchrounsly.

DesktopCLICloud

Environment behaviour

Cloud — not supported. Callback is never called and the operation never completes. A second InstallAsync call throws ArgumentException (duplicate key).

InstallationOperation InstallAsync(Uri uri, Action<InstallationResult> callback)
api.AlgoRegistry.InstallAsync(uri: Uri, callback: Callable[[InstallationResult], None]) -> InstallationOperation

Parameters

Name C# type Python type Description
uri Uri Uri Algo file URI.
callback Action<InstallationResult> Callable[[InstallationResult], None] Callback that will be invoked with installation result.

Returns InstallationOperation — InstallationOperation

Examples

var uri = new Uri("https://example.com/algos/SampleBot.algo");
AlgoRegistry.InstallAsync(uri, result => Print("Installed: {0} | Error: {1}", result.Succeeded, result.Error));
from System import Uri

uri = Uri("https://example.com/algos/SampleBot.algo")
api.AlgoRegistry.InstallAsync(uri, lambda result: api.Print(f"Installed: {result.Succeeded} | Error: {result.Error}"))