public void AddQuery(ICallbackService owner, long value, bool vip) { Monitor.Enter(_queue); _queue.putQuery(owner, value, vip); Monitor.Pulse(_queue); Monitor.Exit(_queue); }
public void Unsubscribe() { ServiceCallBack = OperationContext.Current.GetCallbackChannel <ICallbackService>(); lock (Subscribers) { Subscribers.Remove(ServiceCallBack); } }
static async Task <TResponse> Send <TRequest, TResponse>(TRequest request) { using (ChannelFactory <ICallbackService <TRequest, TResponse> > channelFactory = ClientChannelBuilder.GetChannelFactory <TRequest, TResponse>(serverUrl)) using (ICallbackService <TRequest, TResponse> client = channelFactory.CreateChannel()) { return(await client.SendRequest(request)); } }
public PaymentRequestSubscriber( ICallbackService callbackService, RabbitSettings settings, ILogFactory logFactory) { _callbackService = callbackService; _logFactory = logFactory; _log = logFactory.CreateLog(this); _settings = settings; }
public CallbackController(IBuildCallbackVmService callbackVmService, ICallbackService callbackService, IDistributedCache distributedCache, IApplicationSessionState sessionState, Microsoft.Extensions.Configuration.IConfiguration configuration, ILogger <CallbackController> logger) : base(logger, distributedCache, sessionState, configuration) { _callbackVmService = callbackVmService; _callbackService = callbackService; }
public CallbackController(ICallbackService callbackService, ILogFactory logFactory) { _callbackService = callbackService ?? throw new ArgumentNullException(nameof(callbackService)); if (logFactory == null) { throw new ArgumentNullException(nameof(logFactory)); } _log = logFactory.CreateLog(this); }
public void SendEmailAndNotifyCompletion(string name, string toEmailId, string body) { Console.WriteLine("Now sending email"); //simulate sending of email by sleeping for 5 secs. System.Threading.Thread.Sleep(5000); //Callback client method. ICallbackService callback = OperationContext.Current.GetCallbackChannel <ICallbackService>(); callback.OperationCompleted(string.Format("Hello {0}, Your email to {1} is sent", name, toEmailId));; Console.WriteLine("Email Sent"); }
public void Dispose() { if (m_Service != null) { logout(); m_Service = null; m_Service2.close(); m_Service2 = null; m_Factory.Close(); m_Factory2.Close(); } }
public AuthController(IAuthService authService, ISenderService senderService, ITemplateProcessor templateProcessor, ICallbackService callbackService, IDistributedCache cache, ILogger <AuthController> logger) { _authService = authService; _senderService = senderService; _templateProcessor = templateProcessor; _callbackService = callbackService; _cache = cache; _logger = logger; }
public Executor(IJobRepository jobRepository, ISemaphoreRepository semaphoreRepository, ICommandRepository commandRepository, IPlanner planner, ITimeProvider timeProvider, IEnumerable <IPlugin> plugins, ICallbackService callbackService, ILogging logging) { _jobRepository = jobRepository; _semaphoreRepository = semaphoreRepository; _commandRepository = commandRepository; _callbackService = callbackService; _planner = planner; _timeProvider = timeProvider; _plugins = plugins.ToList(); _logging = logging; if (_plugins.Select(p => p.Urn).Distinct().Count() != _plugins.Count()) { throw new ArgumentException("Invalid plugin configuration, not unique urns detected", nameof(plugins)); } }
public void connect() { EndpointAddress address = new EndpointAddress(new Uri(ConfigurationManager.AppSettings["service"])); //BasicHttpBinding binding = new BasicHttpBinding(); WSDualHttpBinding binding = new WSDualHttpBinding(); //m_Factory = new ChannelFactory<IBooksService>(binding, address); m_Factory = new ChannelFactory <IBooksService>(binding, address); m_Service = m_Factory.CreateChannel(); InstanceContext context = new InstanceContext(this); m_Factory2 = new DuplexChannelFactory <ICallbackService>(context, new WSDualHttpBinding(), new EndpointAddress(new Uri(ConfigurationManager.AppSettings["service2"]))); m_Service2 = m_Factory2.CreateChannel(); m_Service2.dispatch(); }
public void CallBack(ICallbackService notificationService, BasicDeliverEventArgs ea) { byte[] body = ea.Body.ToArray(); string jsonBody = Encoding.UTF8.GetString(body); try { notificationService.ParsePayload(jsonBody); notificationService.ValidatePayload(); notificationService.ExecuteTask(); channel.BasicAck(ea.DeliveryTag, false); Log.Logger.Information("Task executed"); } catch (Exception e) { channel.BasicAck(ea.DeliveryTag, false); Log.Logger.Error("Task failed: " + e.Message); } }
public CallbackController(ICallbackService requestService) { _requestService = requestService; }
public void DoSomethingElse(int value) { ICallbackService callbackService = OperationContext.Current.GetCallbackChannel <ICallbackService>(); callbackService.BeginWcfCall(p => p.Callback(value * 4)); }
public void DoSomething(int value) { ICallbackService callbackService = OperationContext.Current.GetCallbackChannel <ICallbackService>(); callbackService.Callback(value * 2); }
public CallbackController(ICallbackService service, ILogger <CallbackController> logger) { _service = service; _logger = logger; }
void IEditorService.Connect() { Callback = OperationContext.Current.GetCallbackChannel <ICallbackService>(); }
public CallbackController(ILogger <CallbackController> logger, ICallbackService callbackService) { _logger = logger; _callbackService = callbackService; }
public CreatePasswordHandler(IWebUserService userService, LoginContext loginContext, ICallbackService callbackService) { _userService = userService; _loginContext = loginContext; _callbackService = callbackService; }
public void Subscribe() { ServiceCallBack = OperationContext.Current.GetCallbackChannel <ICallbackService>(); Subscribers.Add(ServiceCallBack); }
public SimplePlanner(IEnumerable <IPlugin> plugins, IJobRepository jobRepository, ILogging logging, ICallbackService callbackService) : base(plugins, jobRepository, logging) { _callbackService = callbackService; }
public void putQuery(ICallbackService owner, long value, bool vip) { (vip ? _vipQueue : _regularQueue).Enqueue(new QueryPair(owner, value)); }
public void pollQuery(out ICallbackService owner, out long value) { QueryPair qp = _vipQueue.Count != 0 ? _vipQueue.Dequeue() : _regularQueue.Dequeue(); owner = qp.Key; value = qp.Value; }