You can find some good sample usages in this code such as Promise, Async/Await, spread/rest of array.
I have created a demo project for log handler and TryCatch wrapper (http://kenanhancer.com/2018/06/26/c-trycatchwrapper-and-logging/_.
I need a logger which can write to console and file at the same time. So, I created this demo which creates logger pipeline dynamicly. When code runs, it will write message in console and FileLog.log file at the same time.
It is a very simple example to show how to handle long-running requests in Node.js with RabbitMQ.
You need to have a RabbitMQ docker in development machine.
Install RabbitMQ with Docker
I implemented ES6 syntax for below example.
This Node.js code will get git user details. I used standard ES5 functions and promise.
if you have installed Vagrant CLI, just run the following command to create docker installed virtual box.
The following command will download a Vagrantfile file from Vagrant company in the current directory.
vagrant init kenanhancer/DockerMachine
This command will start the virtual machine.
If you want to check status of virtual machine, run the following command.
If you want to see ports of virtual machine, run the following command.
to connect created virtual machine, run the following command in the Vagrantfile directory.
if you want to see details of Vagrantfile, check it as below.
Creating a Vagrant Package file
vagrant package --output dockermachine.box --vagrantfile Vagrantfile
Every thread will have isolated data. I try to show that concurrent web requests are coming to Controller classes and different data is passed to the threads. Lastly, don’t use with async/await, it is not working properly.