public void Dispose() { _shutdownEvent.Set(); _thread.Join(); _shutdownEvent.Dispose(); _executeCommandEvent.Dispose(); BindingInterfaces.FreeBindingInterface(BindingInterface); }
public IInstance CreateInstance(Package package) { if (_instances.Count >= _maxConcurrentInstances) { throw new ConcurrentInstancesExceededException(); } // AllocateBindingInterface() throws InvalidOperationException if theres no interfaces but this should never happen // provided the configuration prevents max concurrent instances to exceed available binding interfaces var bindingInterface = BindingInterfaces.AllocateBindingInterface(); var id = DateTime.UtcNow.Ticks.ToString("x16"); var instance = new Instance(this, id, package, _logger, bindingInterface, _settings); _instances.Add(id, instance); return(instance); }