简体   繁体   English

REST Web服务中的回调

[英]Callbacks in REST web service

I am working on C#/.Net4.5/VS2017CE, and am developing REST service APIs. 我正在使用C#/。Net4.5 / VS2017CE,并且正在开发REST服务API。 Forgive me if this may be a rather broad question; 如果这是一个相当广泛的问题,请原谅我。 however, I am new to developing REST APIs. 但是,我是开发REST API的新手。

I need to have some way to communicate changes at the server to all interested clients, and to this end, I am looking for some kind of callback mechanism. 我需要某种方式将服务器上的更改传达给所有感兴趣的客户端,为此,我正在寻找某种回调机制。 I am not too keen on polling as it may be costly in my case owing to the potentially large number of client instances. 我不太热衷于轮询,因为在我的情况下,由于可能存在大量的客户端实例,这可能会导致代价高昂。

Needless to add, the server is agnostic of the client platform. 无需添加,服务器与客户端平台无关。

RestService work like ask and answer . RestService工作就像askanswer And if you have an answer and want to say without asking you need to use like open communication.This is means all the client can already waiting your answer. 如果您有答案,并且不想说而要说,则需要使用开放式沟通,这意味着所有客户都可以等待您的答案。 There are some way to do this you can search about signalR , rabbitmq , service bus 有一些方法可以搜索signalR,rabbitmq,服务总线

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM