Server-Side Framework

1 Nov 2018

SMOKE- Server-Side Framework For Swift From Amazon

Do you wonder what this Smoke is all about? It is not about the pollution engulfed environment, but this is the new framework written and built in swift language and it has many other benefits related to it. Let’s discuss further with this post…

What Is Smoke?

As the name suggests, this is a light-weight framework, called Amazon Smoke; it is a new open-source light-weight server-side framework, which is written in Swift and aims to build REST-like or RPC-like services. Its architectural mechanism is based upon the ease of use and gives a pure-functional programming style to the request handlers.

Amazon Smoke is built on Apple’s SwiftNIO and is integrated into the Swift Package Manager. Developers can include it in a project by adding the dependency rule to package.swift

How To Create A Service With Amazon Smoke?

Well, this process only requires three simple steps, wherein the developer needs to follow the steps mentioned below:

  • Define the operations to help you handle the incoming requests. These actions are further defined by a function, which consumes the Operation Input and a generic Application Context, and returns an Operation Output, either synchronously or asynchronously. However, the input and output types hold the Validatable Codable protocol.
  • Select the way to choose the operation handlers to process the incoming requests. With Smoke, developers can attain the StandardSmokeHTTP1HandlerSelector, which can further be used for REST-like services.
  • Set the application server to decode requests, dispatch handlers, and encode and send responses back to the client. The process of encoding and decoding involves the responsibilities of a mobile app, which are further escalated to the application server. With Smoke, developers can include a JSON Payload HTTP1 Operation Delegate for JSON requests and responses.

 

What More Is Special About Smoke?

The key feature of the Smoke framework is the application context, which can be created at launch time and passed to all handlers, on a parallel mode.

However Amazon recommends changing this object strongly-typed and immutable, so the streamlined output can be experienced by eliminating the thread-safe.

Also, with Smoke, by using the context, the handlers can be written as pure-functions and their output would only be dependent on their inputs and the passed context. This eases down the process for the unit test handlers and removes the difference between development and deployment environment to the handlers.

Developers can easily achieve this by using the context to pass any dependency that might differ between development and deployment contexts, such as mocking services, random number generators, etc.

Another exciting feature of Smoke is that by default, any errors thrown from an operation handler would flunk the operation and the framework would return a 500 Internal Server Error to the caller. This would help the developers to secure the leakage of any unintentional error information.

Smoke would definitely turn the testing of operation handlers much easy and without any pain. Albeit, it is advised that operation handlers are pure functions, where the function can be called in unit tests with appropriately constructed input and context instances.

Eventually, this would help the mobile app developers to get the most out of the technology and implement the knowledge in the app platform in much interesting and engaging manner.

On the other hand, if you are looking forward to getting a mobile app developed efficiently, then you must get in touch with a brood of efficient mobile app development in USA to help you get the maximum output of your app concept, as the experienced app developers, hold the relevant exposure to handle the app challenges and turn them into a seamless journey for your targeted audience without a fail.

 

20

Certification

Follow us on Twitter

Ingenious, but confused? Explore these websites & bring out the creative oomph!
An interactive and unique app design is magical! Connect with us at Techugo for prolific & inventive UI/UX designs.

#designthinking #uidesign #uxdesign #tuesdaymotivations

Read to find out how research & development in physical sciences, engineering, and computer sciences are complementing one of the largest industries!

https://t.co/kzadh6ELW3

#agritechnology #agritech #agriculture

Whether breaking the Enigma Machine or conducting assistive surgeries - AI’s pertinence has only increased, it’s perpetual!

Wish to implement AI to operate with intelligence, efficiency & efficacy? Connect with Techugo today!

#ai #artificialintelligence #technology #tech

Tech-aids are preserving & conserving places of cultural significance!
Connect with Techugo for blending in lessons from the past, with the latest techno crafts!
Best wishes on World Heritage Day!

#worldheritageday #WorldHeritageDay2021 #heritageday #heritage

You have made this far!

How about a Coffee together!

Spill the beans – Share your idea

And get a blueprint of your product, for free!

A-26, Sector - 63, Noida, U.P, 201301
5885 Earlscourt Crescent Ottawa ON K4M 1K2
7760 Alyasmin Riyadh 13322 3224 Kingdom of Saudi Arabia
22375 Broderick Dr, Suite 225, Dulles VA 20166
Emaar Square, Boulevard Plaza Tower 1, Dubai

Why don't we start with your name?

Request your copy of Non Disclosure Agreement.

SiteMap | Privacy Policy

2020-2021 (c) Techugo

DMCA Certificate