从信号R自动推送数据 [英] Auto push data from signal R

查看:81
本文介绍了从信号R自动推送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个功能,在网页首次请求业务层读取Apache MQ并通过SignalR发回数据。然而,我很遗憾看到如何使BL持续轮询Apache MQ并在有新项目的情况下推送数据。



我到目前为止所做的工作?



1)有一个带网格的angularjs网页。

2)从网页构造函数.js发出一个signalR调用BL (通过Hub)从服务器返回数据并填充网格。



缺少什么?



1)当队列中有新项目时,如何使BL持续运行或如何使SignalR重新轮询?我看到的聊天,飞机座位预订的例子都是由按钮点击,发送消息等UI动作驱动的。但是在我的情况下,驱动力将在服务器端而不是客户端。



谢谢,



Deepak Vasudevan



我尝试过:



已经提到在问题描述('我做了什么')和(缺少什么)。

I have a functionality that in a webpage first request to business layer reads an Apache MQ and sends the data back via SignalR. However I am at loss to see how to make the Apache MQ constantly being polled by BL and data pushed whenever there is a new item.

What I have done till now?

1) Have an angularjs webpage with a grid.
2) From the webpage constructor.js make a signalR call to the BL (via Hub) which returns the data from server and populates the grid.

What is missing?

1) How to have the BL constantly run or how to make SignalR to re-poll when there is a new item in the queue? The examples I am seeing like chat, plane seats booking are all driven by UI action like button click, send message. However in my case the driving force will be on the serverside and not the client side.

Thanks,

Deepak Vasudevan

What I have tried:

Already mentioned in the problem description ('What I have done') and (What is missing).

推荐答案

你可以尝试应用SqlDependency的概念:使用SignalR和SqlDependency&#8211的ASP.NET中的数据库更改通知; TechBrij [ ^ ]



或者您可以安排频繁推送服务器,就像这里演示的那样:与ASP.NET SignalR推送服务集成 [ ^ ]
You can try applying the concept of SqlDependency: Database Change Notifications in ASP.NET using SignalR and SqlDependency – TechBrij[^]

Or you could schedule a frequent push on the server just like what is demonstrated here: Integrating with ASP.NET SignalR push services[^]


这篇关于从信号R自动推送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆