// That method isn't async itself but can return async task from the channel for awaiting log enqueue. private Task SetInstanceEnabled(bool value) { var enabledTerm = value ? "enabled" : "disabled"; if (InstanceEnabled == value) { AppCenterLog.Info(AppCenterLog.LogTag, $"App Center has already been {enabledTerm}."); return(Task.FromResult(default(object))); } // Update channels state. _channelGroup?.SetEnabled(value); // Store state in the application settings. _applicationSettings.SetValue(EnabledKey, value); // Apply change to services. foreach (var service in _services) { service.InstanceEnabled = value; } AppCenterLog.Info(AppCenterLog.LogTag, $"App Center has been {enabledTerm}."); // Send started services. if (_startedServiceNames != null && value) { var startServiceLog = new StartServiceLog { Services = _startedServiceNames }; _startedServiceNames = null; return(_channel.EnqueueAsync(startServiceLog)); } return(Task.FromResult(default(object))); }