When a Lambda function times out, it gives no warning — boom, your function just stops executing.
One can generally estimate how long a Lambda function will run, and add some cushion, but stuff happens and we should Promise to handle the unexpected as gracefully as possible !!
Create 2 Promises (P1/P2) and wait (race) until 1 of them finishes.
P1: Set a timeout to something less than the Lambda function timeout
P2: Run your business logic
The trick is then using Promise.race to capture when ONE of the promises finishes. In theory, the timeout should almost never happen first…
In layman’s terms …
Thanks for stopping by — following is intended for a non-technical audience, with just enough tech to make it spicy! None of the following is investment advice — just sharing info!
Bitcoin is 2 main things:
We will refer to the currency as “bitcoin” and the overall Platform as “Bitcoin”.
You want to pull similar data from multiple 3rd party sources, inspect the results, and return most relevant content to the user.
Calling each API endpoint sequentially takes too long.
Using Promises, make the call to each API endpoint simultaneously — all of the work, and waiting, happens in parallel.
Above technique was used in the development of https://app.staycay.io — a travel destination assistant.
For example, when user requests ‘cooking classes’ for a given destination, the AWS Lambda Node.js …
In an AWS serverless environment, the default solution for very low latency data access is usually DynamoDB.
Read response times depend on a variety of things, but for round numbers lets call it in the 10–20 milliseconds range (what I have experienced), to perform a keyed lookup from Lambda. What’s not to like.
This article discusses an approach to achieve sub-millisecond performance on datasets still in the multi-1000 records. This opens the door to more use cases, offers more control of data and access, and of course there’s raw performance.
Video demo of some of the key features in action
Implemented as Travel Destination Chatbot(staycay.io)
Getting a handle on what-it-takes, pieces-and-parts is often difficult to conceive — overwhelm is more the initial reaction. Following aims to orient both techies and tech-interested business folks to the main components. This is clearly an AWS-centric architecture, but many of the concepts apply to different infrastructure approaches.
But aren’t there a million ways to build a chatbot these days (“and it only takes 10 minutes!”) ? Maybe, but when a certain level of sophistication & control is needed, it’s a different ballgame, e.g …
Discover → Plan → Do → Save & Share
City Overview. Day Planner. City Walks. Bookable activities, events, hotels, retreats, vacation homes. Plus all the destination details …
30 Countries — 6500+ cities, so far.
Watch: Video Demo
Go Play: staycay.io
For all the details, keep reading.
Considering visiting Seattle, Washington for the weekend? Never been & don’t know much about it. Where to start?
www.facebook.com/petbotai & FB Messenger: petbotai
To dig deeper into the chatbot hype, I embarked on this wacky project of building one that took on the personality of anyone’s pet(s).
OK, the personality part is a stretch goal, but forced more creativity. Some Machine Learning techniques were thrown in to provide “cool tricks” your hi-tech virtual pet might do, like Image Style Transfer and Word Association!
Had to learn enough about a few things to get rolling, e.g. Dialogflow, Node.js, AWS DynamoDB, Facebook Messenger Bots, Machine Learning options and then integrate with various provider API’s.
The following online training was invaluable…