Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Asynchronously



  The evolving history of asynchronous operation in JavaScript

JavaScript is single threaded, it means there would be only one task running at any point of time. But this would slow down the overall program execution if there is long running task, hence asynchronous task execution is desired in complex cases. To achieve asynchronous task execution, there are a few options introduced in JavaScript. setTimeout/setInterval Event Promise Async/Await setTimeout/setInterval is one of the first mechanisms introduced in JavaScript to simulate asynchronous operati...

   JAVASCRIPT,ASYNC,PROMISE,AWAIT     2019-11-09 08:21:56

  Load and execute JavaScript

When we load and execute JavaScript in a webpage, there are many points we need to care about because of its design and feature. There are two features about JavaScript execution in a browser: 1). The JavaScript codes will be executed immediately once loaded;2). When JavaScript codes are being executed, they will block the following contents (including page rendering and other resources downloading). So if there are multiple js files to be loaded, these codes will be executed sequentially. Since...

   JavaScript,async,defer,load,execute     2013-06-07 04:53:46

  A Javascript When Function

function when(conditionFunc, execFunc, interval){ if (conditionFunc()){ execFunc(); }else{ setTimeout(function(){ when(conditionFunc, execFunc, interval);}, interval); } } You have some code which should only execute when a condition is true. E.g. You have code which relies on a javascript library but can't be sure the library has loaded yet and don't want the code to execute until it has. This is common if you have a bookmarklet which injects more than one <...

   JavaScript,When,Implementation,When function     2012-02-24 05:08:34

  How to do pprof for gRPC service

gRPC is a RPC framework based on HTTP and is frequently used for communications among micro service inside the same organization network. However,  the service functions cannot be accessed via normal HTTP URL as it's not a WEB framework. In this case, how to do pprof on a gRPC service? The trick is starting a HTTP server asynchronously while starting the gRPC service. This HTTP server can be accessed to run prrof debug. go func(){ http.ListenAndServe(":10001", nil) }() Since it uses the de...

   GOLANG,PPROF,GRPC     2021-01-29 23:11:33

  An easy way to log client side information to server

JavaScript debug is a very troublesome thing in web application development. Because many web browsers will not notify you if there is any error in the JavaScript codes you write. They just silently fail and block the following codes execution. In order to debug JavaScript codes, we need a good log mechanism which will help us log the error information,, we often need to log errors in JavaScript codes to server for debug purpose in a production web application, What should we do? The first ...

   JavaScript log, Ajax,Image,Debug     2012-12-30 09:16:50

  What is cache penetration, cache breakdown and cache avalanche?

When designing and developing highly available system, cache is an very important consideration. It is useful to cache some frequently accessed data so that they can be accessed quickly and also cache can protect the downstream system like DB from being hit too often.  To provide better cache design in large systems, some problems may need to be considered first. In this post, we will talk about some frequently discussed cache problems and mitigation plans. Cache penetration Cache penetrati...

   SYSTEM DESIGN,CACHE PENETRATION,CACHE BREAKDOWN,CACHE AVALANCHE     2020-04-10 08:43:00

  Easy Parallel Processing in PHP

The proliferation of multicore CPUs and the inability of our learned CPU vendors to squeeze many more GHz into their designs means that often the only way to get additional performance is by writing clever parallel software. One problem we were having is that some of our batch processing jobs were taking too long to run. In order to speed the processing, we tried to split the processing file into half, and let a separate PHP process run each job. Given that we were using a dual core serv...

   PHP,Parallel processing,Multithreading like,Sleep     2011-12-12 10:58:59

  How to Asynchronously Upload Files Using HTML5 and Ajax

In my previous posts, we discovered How to Use HTML5 File Drag & Drop, and Open Files Using HTML5 and JavaScript. Now we have a valid set of files, it possible to upload each one to the server. The process occurs asynchronously in the background so the user can complete other on-page tasks while it occurs.The HTMLLet’s examine our HTML form again:view plainprint?<form id="upload" action="upload.php" method="POST" enctype="multipart/form-data"> ...

   HTML5,File upload,AJAX,Asynchronously,X-FILENAME     2011-10-29 13:45:00

  When and How to Use the Go Channel

Go’s concise structure and powerful native library enable us to hit the ground running easily. It is more efficient than Java or Python when implementing the same functions, especially its concurrent programming, which is very handy and widely admired due to its goroutine and channel. goroutine and channel has much to dig into, and let’s start with channel, which I used to consider narrowly as a message queue to transfer data between gorouti...

   GOLANG,CONTEXT,CHANNEL     2022-09-17 23:06:36

  Let’s Find Out What the Future holds for .Net Technology

Technology is more like an evolution, not a revolution. The disruptive industry seems to be changing day in day out. Due to which tech companies by default have to chase new trends in order to stay ahead of the curve. Now, Microsoft.Net framework has been around since the 1990s! Do you think such refined technology can be considered relevant now? From what I can see, .Net is going through a major transformation. It’s gone largely open source and has been getting modernized so that its wor...

   ASP.NET ,.NET     2018-06-12 05:07:53