【发布时间】:2015-03-19 07:05:10
【问题描述】:
我在我的门户上插入新闻,并在新闻插入数据库时向所有注册的设备发送通知。我有这么多注册的设备,所以我希望在后端发送这些通知,以便用户继续插入新闻,并且对于每个插入的新闻通知应该排队并在后端发送。
目前我正在插入新闻,然后发送通知。现在的问题是,在所有通知发送过程完成之前,我无法插入另一个新闻。 我的代码如下-
public void InsertNews()
{
int newsId=insertNewsOnDb();
string msg="My Json String";
DataTable dt=getAllUsers();
foreach(DataRow dr in dt.Rows)// I want this process to run on backend so
{ // it does not affect the processing of
string gcmId=dr["GcmId"]; // inserting news.
sendPushNotification(gcmId,msg);
}
}
【问题讨论】:
标签: c# asp.net .net process notifications