예제 #1
0
 public Daemon(
     string pathToExecutable,
     string workingDir,
     Action <Message> onMessage,
     Action <Exception> onException,
     KinesisProducerConfiguration config,
     IDictionary <string, string> environmentVariables)
 {
     this.pathToExecutable         = pathToExecutable;
     this.workingDir               = workingDir;
     this.onMessage                = onMessage;
     this.onException              = onException;
     this.config                   = config;
     this.environmentVariables     = environmentVariables;
     this.cancelTokenSource        = new CancellationTokenSource();
     this.processCancellationToken = cancelTokenSource.Token;
     this.logger                   = Logging.CreateLogger <Daemon>(config.LogLevel);
     Task.Run(() =>
     {
         try
         {
             CreatePipes();
             StartChildProcess();
         }
         catch (Exception e)
         {
             FatalError("Error running child process", e);
         }
     });
 }
예제 #2
0
        public KinesisProducer(KinesisProducerConfiguration config)
        {
            this.config = config;
            this.logger.LogInformation($"Platform: {RuntimeInformation.OSDescription}. Arch: {RuntimeInformation.OSArchitecture}");

            var caDirectory = ExtractBinaries();

            this.envParams = new Dictionary <string, string>
            {
                { "LD_LIBRARY_PATH", this.pathToLibDir },
                { "DYLD_LIBRARY_PATH", this.pathToLibDir },
                { "CA_DIR", caDirectory }
            };

            CreateDaemon();
        }
예제 #3
0
 public DaemonUnix(string pathToExecutable, string workingDir, Action <Message> onMessage, Action <Exception> onException, KinesisProducerConfiguration config, IDictionary <string, string> environmentVariables)
     : base(pathToExecutable, workingDir, onMessage, onException, config, environmentVariables)
 {
 }