Ejemplo n.º 1
0
        /// <summary>
        /// Creates a delegate which spawns a silo in a new process, using the provided executable as the entry point for that silo.
        /// </summary>
        /// <param name="executablePath">The entry point for spawned silos.</param>
        public static Func <string, IConfiguration, Task <SiloHandle> > CreateDelegate(string executablePath)
        {
            return(async(siloName, configuration) =>
            {
                var result = new StandaloneSiloHandle(siloName, configuration, executablePath);
                await result.StartAsync();

                return result;
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Spawns a new process to host a silo, using the executable provided in the configuration's "ExecutablePath" property as the entry point.
        /// </summary>
        public static async Task <SiloHandle> Create(
            string siloName,
            IConfiguration configuration)
        {
            var executablePath = configuration[ExecutablePathConfigKey];
            var result         = new StandaloneSiloHandle(siloName, configuration, executablePath);
            await result.StartAsync();

            return(result);
        }