To manage all services registered, we need a data structure that keeps track of them and also removes services that seem to be not available anymore. The service registry class will provide this.
- [Narrator] Finally we will now implement the logic…that provides the service registry.…For that we will create a class that keeps track…of all services.…It should have methods for adding and removing them.…Additionally we want to make sure that a service…gets removed if we don't hear from it for a certain time.…This is why we made sure that our time service…announces itself every 15 seconds.…To get started, create a file called service registrey…dot GS in server.…So I click right on server, new file and name it…service registry dot GS.…
On top of this file we again add use strict.…Now we add the class that's ESX syntax so we add…class service registry and first we will implement…a constructor.…So we add constructor.…It gets no arguments and we will keep track…of available services in an array and we will intiate…this now.…
So add this dot underscore this marks this array…as private services, equals and then square brackets.…And we also want to set the time out here.…This will be the time out in seconds after which we will…
After explaining some basics about Node.js and microservices, Daniel shows you how to sketch out the planned architecture for your application and get the boilerplate code, modules, and credentials in place. Next, he shows how to create a bot user in Slack, connect to Slack, and post messages. He also shows you how to get your bot to process variations in text by creating logic that delegates the processing of intent to dedicated modules. Lastly, he shows how to register additional services and he covers how to use monitoring to identify architectural or performance issues.
- Using Slack APIs
- Sketching out a Slack bot architecture
- Setting up a project and choosing modules
- Creating and naming your bot
- Connecting to Slack
- Setting up and using natural language processing
- Routing by intents
- Implementing geocoding and time calculation
- Adding and monitoring services