473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to display poll for all logged users after the creation of the vote?

1
I'm working on the project 'vote/poll' on android device's. I want it to work like this: - Users can login(I got REST API php for login/register and its okay for me and working), - Admin can create new voting(available options: yes, no) - i can do it with rest api and its easy for me(I'm beginner). My problem is how to display question and answers(yes/no) for all logged users? I think that I can make async method in client side like timer(send request to api per 1 sec and check new question in database, if it's new return response json) but i think that it's not professional(?) and very expensive(for server). Second solution is websocket but I have never used it and I'm afraid of it that I can't handle it. What do you think? Is there any other way?

BTW: 40 employees will use my system(Every Saturday for 3-5h only).
Jan 6 '20 #1
1 3238
gits
5,390 Expert Mod 4TB
well 1 sec polling is really a bad idea - if it has to be that 'realtime' better use websockets (WS) or server side events (SSE). If it would be enough to poll each minute - then you probably can poll if thats easier for you to implement and you are under time pressure - but WS or SSE are to prefer. at least if it is a webapplication - what i assume from your post. If you have a native app - then the proper method would be push notifications i think since they would drain less battery.

PS: if you still decide to make 1sec XMLHttpRequest then its not simple as well - since they are async you cannot ensure when they return if you simply send them out and dont implement a serialization method so the returns are displayed in the correct timely order. So dont just fire them off with setInterval and think its done then :)
Jan 7 '20 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Marcin Zmyslowski | last post by:
Hello all! I want to create a page in ASP language which gives me information about currently logged users. I thought to do it by this way: when somebody will log in to page, there will be a...
2
by: Vaj | last post by:
hi, i would be very thankful if u can help me in solving this problem. my problem is i 've a page in that i'm displaying the creation dates of all files. these dates are like server dates . now...
0
by: SR | last post by:
Suppose I have to create a dozen of users taking their data from a list Membership let me do it with the Create method, but what about Profile ? eg. I want FullName, Age (in Profile) UserId, pwd...
6
by: Xavier | last post by:
hello, what is the best way to display display the time needed for rendering the information. I must get the difference of time from the start of rendering till the finish rendering the page -...
2
by: j.m.osterman | last post by:
I haven't found exactly what I've been trying to do. All I am trying to do for now is just display usernames from Active Directory into a ListBox control on a page. I have found some code...
6
by: ryan2345 | last post by:
Hi, I have made a website wherein the user creates his account. Then the user can login into his account, update his account, search for people with different key skills. Theres also a discussion...
13
by: snowinfo | last post by:
Hi all, any way to count the number of users i have logged into my site? any help/code appreciated, craig
1
by: zy413952631 | last post by:
list the number of times each user is logged on Thank you for your kind concern
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.