Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

simple node.js program to show difference between default async and sequential serial processing

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README
Octocat-spinner-32 async_vs_serial.js
README
    async_vs_serial    

    Simple Node.js program to compare async default processing with serialised processing

    For serial / sequential processing, a list of work functions is provided, each calling next
    The implementation of next takes the frontmost work function off the list and executes it

    Handy for database processing where sequence needs to be preserved
    Simple enough to illustrate the async nature of Node.js

    Sample output :

    Default run

        > time ./async_vs_serial.js async

        RUNNING ASYNC
        >aaa
        >bbb
        >ccc
        <bbb took 50ms
        <ccc took 120ms
        <aaa took 220ms

        real    0m0.325s
        user    0m0.090s
        sys 0m0.012s

    Serial run

        > time ./async_vs_serial.js serial

        RUNNING SERIAL
        >aaa
        <aaa took 220ms
        >bbb
        <bbb took 51ms
        >ccc
        <ccc took 120ms

        real    0m0.479s
        user    0m0.075s
        sys 0m0.011s

    
    blog : quantblog.wordpress.com         
Something went wrong with that request. Please try again.