Cricket score update features on the client side

Looking for assistance with client-side code development! I am currently working on an Android application using Ionic that involves live cricket scores. I have purchased a cricket API and understand how to connect to it using Node.js on the server side. However, on the client side, which uses Angular 8, my requests are being blocked by the server every 2 seconds. I want to optimize my Angular 8 code to prevent my server from blocking the requests. I have looked into using socket IO, but I would still need to send requests to the Cricket API server every 2 seconds through my Node.js server. Is this the correct approach? I am seeking advice from others who may be working on similar projects. Any help is greatly appreciated!

Answer №1

In the event that the Cricket API does not have support for Push Notification, it is important to seek assistance from the support team. In such cases, resorting to Pulling becomes necessary.

A potential solution could involve setting up a dedicated cricket-api-adapter server to handle the pulling of data from the Cricket API. This intermediary service can then publish each update to a PubSub/Queue for other API servers to consume and stay updated.

This approach enables the creation of a Gateway for application clients to seamlessly receive Push Notifications from the system.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to retrieve the io object within the io.sockets.on callback function?

My preference is to not alter my sockets method. I was hoping to be able to utilize the io object within the connected function. Could this be a possibility? function sockets (server) { const io = require('socket.io')(server); io.sockets.on ...

Is it possible to adjust the width of a parent element based on the number of child

In this particular example, I have structured a header with a logo-container positioned on the left side, a menu in the center, and a button on the right. The menu consists of 5 top-level items and 2 sub-menus. <div class="container"> <div cla ...

Issue with Jquery .scroll method not triggering display:none functionality

Styling Using CSS #acc-close-all, #to-top { position: relative; left: 951px; width: 29px; height: 42px; margin-bottom: 2px; display:none; } #acc-close-all a, #to-top a { position: absolute; float: right; display: block ...

JavaScript Array Objects

As a newcomer to the world of Javascript, I've decided to take on the challenge of creating a blackjack game. Utilizing arrays and objects for my game: card = {}, //each card is represented as an object with suit, number, and points properties playe ...

Tips for loading and updating data simultaneously in VUEJS from a single input

Currently, the data is displayed in a span tag with an input for updating it Is it possible to fetch data from an API, load it into an input field, update the input with new information, and send it back? What are the best approaches for achieving this? ...

Having trouble getting Typescript code to function properly when using commonjs style require statements

I am completely new to Typescript, Node.js, and Express. Following the instructions outlined in this tutorial (https://www.digitalocean.com/community/tutorials/setting-up-a-node-project-with-typescript), I set up my project exactly as described there. The ...

Patterns for RESTful routes

I have set up the routes 'customers/45' and 'customers/recently-created' in my express application, but for some reason the 'customers/recently-created' route is not calling 'CustomerHandler.getRecentlyCreatedCustomers&ap ...

Tips for making a dynamic link button using Angular

I am currently working on creating responsive buttons that will navigate to specific pages using Angular routing. Here is my routing configuration: const routes: Routes = [ { path: 'home', component: HomeComponent}, { path: ' ...

Learn how to move to a new line when inputting data into a CSV file with JavaScript

My challenge involves taking an array of objects, for example: array=[hello, how, are, you], extracted from the document.innerHTML. I aim to write these objects to a CSV file using puppeteer and JavaScript, each on a new line. Although when using the sta ...

Potential Unresolved Promise Rejection in React Native

When attempting to run the application, I encountered an issue where the server was not working and Node.js displayed an error message. I am unable to determine the cause of this error. Can anyone please assist me in resolving this issue? As a newcomer t ...

creating sleek animations with Pixi.js for circular shapes

Is it possible to create smooth animations on circles or sprites similar to D3.js hits in Leaflet? https://drive.google.com/file/d/10d5L_zR-MyQf1H9CLDg1wKcvnPQd5mvW/view?usp=sharing While D3 works well with circles, the browser freezes. I am new to Pixi. ...

Is employing absolute paths in our confidential Node dependencies a good idea?

I have recently organized our codebase's React components into a separate dependency to make them reusable across different projects. To improve readability, all components now utilize Webpack aliases: import TestComponent from 'components/TestCo ...

Manipulating Object Properties in the Browser's Console

When I log a JavaScript object in the browser, my curiosity leads me to expand it in the console window. An example of this is: console.log(console); I discover what's inside, but then a thought crosses my mind. When I dig deeper and expand the obje ...

Converting JSON objects into TypeScript classes: A step-by-step guide

My challenge lies in converting Django responses into Angular's User array. This conversion is necessary due to variations in variable names (first_name vs firstName) and implementing specific logic within the Angular User constructor. In simple term ...

Error: The process object is not recognized in this Node.js application using Jade templating

This project was created using Webstorm's Express template. All necessary npm dependencies have been installed! When I run the application, the result page looks fine. However, the console always displays: 'ReferenceError: process is not defin ...

Making changes to an input field can impact other elements when using the v-model directive

I am facing an issue with a cart setup where the quantity of all products are being updated when I increase the quantity of one product. How can I prevent this and only update the quantity of the selected product? <div v-for="(product, index) in cartPr ...

Creating test cases for a third-party CLI package

I have successfully created a command-line interface (CLI) program using yargs. I have managed to cover test cases for all the functions exported by the application. However, there seems to be a gap in the test coverage from lines 12-18. Can you provide i ...

Model calculates product of two columns using Sequelize

Is it possible to multiply the quantity and unit columns from a table using sequelize's findAll method? Products.findAll({ attributes: [ 'id', 'Product', 'Quantity', ' ...

Express not receiving data from HTML form submission

Check out my HTML form below: <form method="post" id="registration-form" action="/register"> <div class="form-group"> <label for="UsernameRegistration">Username:</label> <input type="text" class="form- ...

How to access objects in Angular2 without using pipe or ngFor

Suppose I have the following data in an asymmetric array: [{'name':'user','password':'123'},{'title':'officer','grade':'5','age':'5'}] which is obtained f ...