• Skip to main content
  • Skip to footer

InRhythm

Your partners in accelerated digital transformation

  • Who We Are
  • Our Work
  • Practices & Products
  • Learning & Growth
  • Culture & Careers
  • Blog
  • Contact Us

Product Development

May 30 2023

How To Build Full Stack Applications In AWS Amplify

Based on a Lightning Talk by: Nikolai Tarasov, Senior iOS Engineer @ InRhythm on May 18th, 2023

Overview

AWS Amplify is a comprehensive development platform offered by Amazon Web Services (AWS) that simplifies the process of building web and mobile applications. It provides developers with a set of tools, services, and libraries that streamline the development workflow and enable rapid iteration.

In Nikolai Tarasov’s Lightning Talk session, we will explore the key features of AWS Amplify and discuss its advantages in building modern applications:

  • Overview
  • What Is AWS Amplify?
  • Key Features Of AWS Amplify 
  • Advantages Of AWS Amplify
  • Closing Thoughts

What Is AWS Amplify?

AWS Amplify is an open-source framework that enables developers to build scalable and secure applications with ease. It abstracts away the complexities of backend infrastructure setup, allowing developers to focus on building features and delivering value to end-users. Amplify supports popular frontend frameworks such as React, Angular, and Vue.js, making it accessible to a wide range of developers.

Key Features Of AWS Amplify

  • Authentication And Authorization

Amplify provides a simple and secure way to add user authentication and authorization to your applications. It integrates with popular identity providers like Amazon Cognito, allowing you to easily handle user sign-up, sign-in, and password recovery flows. Amplify also provides fine-grained access control and role-based permissions, ensuring that only authorized users can access specific resources within your application.

  • Data Storage And APIs

With Amplify, you can easily integrate your application with various data storage options such as Amazon DynamoDB, Amazon Aurora, or Amazon S3. Amplify’s DataStore API simplifies data synchronization between your frontend and backend, providing real-time updates and offline capabilities. It also supports GraphQL and REST APIs, making it flexible to work with different data models and query patterns.

  • Serverless Functions

AWS Amplify enables you to write serverless functions using AWS Lambda. These functions can be triggered by events and integrated seamlessly into your application’s backend. Amplify also provides built-in support for common use cases such as file uploads, image transformations, and sending notifications. With serverless functions, you can extend your application’s functionality without managing traditional server infrastructure.

  • Hosting And Deployment

Amplify simplifies the process of hosting and deploying your applications. It provides a managed hosting service that automatically provisions and configures the necessary infrastructure to serve your frontend assets. Amplify seamlessly integrates with popular Git-based workflows, allowing you to deploy your application with a simple push to your preferred Git repository.

Advantages Of AWS Amplify

  • Rapid Development And Iteration

AWS Amplify accelerates the development process by abstracting away the complexities of backend infrastructure and providing a streamlined workflow. It enables developers to focus on building features and delivering value to end-users without getting caught up in infrastructure management. The ease of integration with popular frontend frameworks further speeds up development time.

  • Scalability And Security

By leveraging AWS services such as Amazon Cognito, AWS Lambda, and DynamoDB, Amplify provides a scalable and secure foundation for your applications. AWS’s robust infrastructure ensures that your application can handle increased traffic and demand. Amplify’s built-in security features, such as user authentication and fine-grained access control, help protect your application and data.

Closing Thoughts

AWS Amplify simplifies the process of building web and mobile applications by abstracting away the complexities of backend infrastructure. It offers a comprehensive set of features, including authentication, data storage, serverless functions, and hosting, that enable developers to build scalable and secure applications with ease. By leveraging AWS services and integrating seamlessly with popular frontend frameworks, Amplify provides a streamlined development workflow and facilitates rapid iteration.

Written by Kaela Coppinger · Categorized: Code Lounge, Learning and Development, Product Development · Tagged: Application Development, AWS, best practices, Full Stack Apps, iOS Engineering, learning and growth, Mobile Development

May 23 2023

How To Effectively Measure The Direct Impact Of Your Design Language System

Author: Ashton Coghlan, Senior Product Manager and Oleg Ivanov, Design Tech Architect @ InRhythm

Overview

The work of your designers has a substantial impact on your business, despite it sometimes being a challenging, tangible KPI to measure. Showing the value of your designers’ work, can result in a positive focus on business goals around the needs of your users. You can start driving value around the infrastructure of a Design Language System so that your designers can focus on higher value problems, moments of delight in your customers’ experiences, and your overall product quality. A Design Language System can help refine the quality of your product by making the experience more consistent, predictable, and accessible. 

In order to understand the lasting impact of a Design Language System in your organization, we’ll be prioritizing some high-level subject areas:

  • Overview
  • What Is A Design Language System?
  • How Do We Measure The Business Impact Of A Design Language System?
  • What Are The Leading Indicators To Measure Impact?
  • Design Efficiency
  • Developer Efficiency 
  • Closing Thoughts

What Is A Design Language System?

A Design Language System is a collection of reusable design components, guidelines, and standards that are used to create a consistent and cohesive user experience across an organization’s products and services. It is a set of rules and principles that guide the design and development process, ensuring consistency and coherence in the design of digital products.

A Design Language System includes not only visual elements like typography, color palettes, and iconography, but also components like buttons, forms, and navigation menus, as well as guidelines for interaction design, accessibility, and branding. The purpose of a Design Language System is to streamline the design and development process, reduce inconsistencies, and improve the efficiency and effectiveness of design teams. It also ensures a better user experience, making it easier for users to interact with and navigate through digital products.

How Do We Measure The Business Impact Of A Design Language System?

Measuring business impact is important because it helps organizations understand the value that their Design Language System is providing to the business. By tracking key metrics, organizations can identify areas where the Design Language System is driving business outcomes, as well as areas where it may need to be improved.

Here are some key metrics to measure business impact:

  • Return On Investment (ROI): This metric measures the financial impact of the Design Language System on the organization. It helps to determine whether the investment in the Design Language System is paying off in terms of increased revenue, cost savings, or other financial benefits.
  • Time To Market: This metric measures the speed at which new products or features can be launched to the market using the Design Language System. It helps to determine whether the Design Language System is enabling the organization to be more agile and responsive to market changes.
  • Customer Satisfaction: This metric measures how satisfied customers are with the products or services that are built using the Design Language System. It helps to ensure that the Design Language System is meeting the needs and expectations of customers, and can also provide insights into areas where improvements may be needed.
  • Employee Productivity: This metric measures the efficiency and effectiveness of the design and development teams that are using the Design Language System. It helps to determine whether the Design Language System is improving productivity, reducing errors, and enabling teams to work more collaboratively and efficiently.

What Are The Leading Indicators To Measure Impact?

Adoption and usage are the only things that matter after you know what you need to build. And the sneaky hard part of this is you often don’t know what you truly need to build until you measure adoption and usage. (This is where the magic of Product Management comes into play!)

Here are some key metrics to measure adoption and usage of a Design Language System:

  • Number Of Active Users: This metric measures the number of users who have actively used the Design Language System components in a given period, such as a week or a month. It helps to gauge the reach and impact of the Design Language System across the organization.
  • Number Of Design Language System Components Used: This metric measures the number of unique Design Language System components used in products or applications. It helps to identify which components are most popular and which ones are underutilized.
  • Number Of Design Language System Integrations: This metric measures the number of products or applications that have integrated the Design Language System. It helps to determine how widespread the adoption of the Design Language System is across the organization.
  • Number Of Design Language System Updates: This metric measures the number of updates made to the Design Language System in a given period, such as a week or a month. It helps to ensure that the Design Language System is up-to-date and relevant to the changing needs of the organization.
  • User Feedback And Satisfaction: This metric measures user feedback and satisfaction with the Design Language System, which can be collected through surveys, user testing, or other means. It helps to identify areas for improvement and to ensure that the design language system is meeting the needs of its users.

By tracking these metrics, organizations can gain insights into the adoption and usage of their Design Language System and make data-driven decisions to improve its effectiveness and impact.

Design Efficiency

Measuring design efficiency is important because it helps organizations ensure that their Design Language System is supporting efficient and effective design processes. By tracking key metrics related to design efficiency, organizations can identify areas where they can streamline workflows, reduce errors, and improve the quality and consistency of their design outputs.

Here are some key metrics to measure design efficiency:

  • Time To Create New Designs: This metric measures the amount of time it takes to create new designs using the Design Language System. It helps to identify areas where the Design Language System may be slowing down the design process or where additional training or resources may be needed to improve efficiency.
  • Time To Make Updates To Existing Designs: This metric measures the amount of time it takes to make updates to existing designs using the Design Language System. It helps to identify areas where the Design Language System may be creating bottlenecks or inefficiencies in the design process.
  • Design Consistency: This metric measures the level of consistency and coherence in the design outputs produced using the Design Language System. It helps to ensure that designs are aligned with brand standards and that user experience is consistent across different products and services.
  • Design Quality: This metric measures the quality of the design outputs produced using the Design Language System, including factors such as usability, accessibility, and visual appeal. It helps to ensure that designs are of a high standard and meet the needs and expectations of users.

By tracking these metrics, organizations can gain insights into the efficiency and effectiveness of their design processes, identify areas for improvement, and ensure that their Design Language System is supporting high-quality design outputs that meet the needs of users and the business.

Developer Efficiency

Measuring developer efficiency is important because it helps organizations ensure that their Design Language System is supporting efficient and effective development processes. By tracking key metrics related to developer efficiency, organizations can identify areas where they can streamline workflows, reduce errors, and improve the quality and consistency of their development outputs.

Here are some key metrics to measure developer efficiency:

  • Time To Implement New Designs: This metric measures the amount of time it takes developers to implement new designs using the Design Language System. It helps to identify areas where the Design Language System may be slowing down the development process or where additional training or resources may be needed to improve efficiency.
  • Time To Make Updates To Existing Designs: This metric measures the amount of time it takes developers to make updates to existing designs using the Design Language System. It helps to identify areas where the Design Language System may be creating bottlenecks or inefficiencies in the development process.
  • Developer Satisfaction With The Design Language System: This metric measures the satisfaction of developers with the Design Language System, including factors such as ease of use, accessibility, and usefulness. It helps to ensure that the Design Language System is meeting the needs and expectations of the development team and that they are able to work more efficiently and collaboratively.
  • Number Of Bugs And Issues: This metric measures the number of bugs and issues that are encountered during the development process using the Design Language System. It helps to identify areas where improvements may be needed in the Design Language System, as well as areas where additional training or resources may be needed to reduce errors and improve efficiency.

By tracking these metrics, organizations can gain insights into the efficiency and effectiveness of their development processes, identify areas for improvement, and ensure that their design language system is supporting high-quality development outputs that meet the needs of users and the business.

Closing Thoughts

In summary, a Design Language System is a collection of reusable design components, guidelines, and standards that are used to create a consistent and cohesive user experience across an organization’s products and services. Measuring the success of a Design Language System is important because it helps organizations ensure that the system is meeting the needs of users and the business. There are several key metrics that organizations can track to measure the success of their Design Language System, including adoption and usage metrics, design efficiency metrics, developer efficiency metrics, and business impact metrics.

To track and analyze these metrics, organizations can use tools such as analytics platforms and surveys, as well as conduct user testing and gather feedback from development teams. Product Managers can play a critical role in driving the success of a Design Language System by setting clear goals and objectives, identifying key metrics to track, and ensuring that the Design Language System is meeting the needs of users and the business.

At InRhythm, we have extensive experience in helping organizations set up their design language systems for success. Our team of experts can provide guidance on best practices for tracking and analyzing key metrics, as well as help organizations develop and implement a design language system that is tailored to their unique needs and goals. If you’re interested in learning more about how we can help your organization succeed with its Design Language System, please don’t hesitate to reach out to us.

Written by Kaela Coppinger · Categorized: Agile & Lean, Design UX/UI, Learning and Development, Product Development · Tagged: best practices, Design Language Systems, Design Programs, learning and growth, product design, product development, Product Management, ux, uxui

May 16 2023

Why Your Design Language System Needs A Product Manager

Overview

A Senior Product Manager specializing in Enterprise Design Language Systems offers expertise in creating, scaling, and optimizing cohesive Design Language Systems that drive efficiency, consistency, and innovation across large organizations. By leveraging their deep understanding of product development, user experience, and cross-functional collaboration, they empower enterprises to accelerate innovation, hack their own bureaucracies, and enhance product quality while reducing design debt, as well as development and maintenance costs. 

In Ashton Coghlan’s Lightning Talk session, we will be uncovering the the primary strategies for effectively Product Managing Design Language Systems:

  • Overview
  • What Is A Design Language System?
  • What Does A Product Manager Bring To Your Design Language System?
  • Top 10 Reasons To Hire A Product Manager
  • Closing Thoughts

What Is A Design Language System?

By direct definition, a Design System is a collection of reusable components, guided by clear standards, that can be assembled together to build any number of applications. According to Emmet Connolly, Director Of Product Design at Intercom, “… most Design Systems are really just Pattern Libraries: a big box of UI Lego pieces that can be assembled in near-infinite ways. All the pieces may be consistent, but that doesn’t mean the assembled results will be. Your product is more than just a pile of reusable UI elements. It has structure and meaning. It’s not a generic web page, it’s the embodiment of a system of concepts.” 

The Design Language System can be considered the source of truth for how elements look and behave.

  • Designers, developers and content authors can use the DLS to check if an element of design already exists
  • Content authors can use the DLS for instructions on how to use certain design components

Like a natural language, the Design Language System is supposed to grow over time as components are progressively added to it.

Design Language Systems are aimed to be a shared Language for understanding design, that transparently leads to understanding implementation. 

In short, a Design Language System is a living, breathing organism that guides and supports the building blocks of your product.

What Does A Product Manager Bring To Your Design Language System?

Design Systems have become an essential part of efficient product development workflows, and there is a great benefit to treating the system as a product itself. Design Systems are ever-evolving tools and processes that need product management to support the full lifecycle from the initial build throughout ongoing maintenance and iterations.

The collaborative efforts of a cross-functional product trio including design, engineering, and product management are key to building a successful Design System that will continue delivering value to an organization over time. 

As the Design System matures, a product manager can help keep a groomed backlog for new releases, maintain intake and support processes, and measure/report on the impact of the Design System to ensure ongoing investment.  

Top 10 Reasons To Hire A Product Manager

Where system designers and engineers have the subject matter expertise to build a Design System that’s compatible with current workflows and technology, a dedicated product manager can help align the vision for the System to the goals of the organization, prioritize the roadmap based on those goals, and build a communications strategy to drive adoption and create feedback loops with consuming teams.

Proven benefits of hiring a Product Manager to support the implementation of your Design Language System are:

  1. Cross-functional Collaboration– A product manager facilitates communication and collaboration among different teams, such as design, development, and business. This ensures that the Design Language System meets the needs of all stakeholders.
  2. Strategic Vision– Product managers have the ability to define and execute a long-term strategy for the Design Language System, ensuring it aligns with the company’s goals and objectives.
  3. Prioritization– With many competing demands, a product manager can prioritize features and improvements to the Design Language System, maximizing the value delivered to the organization.
  4. Customer Focus–  Product managers have experience understanding customer needs and incorporating their feedback into the Design Language System. This ensures a user-centric approach that improves usability and adoption (Your downstream product teams are your customers).
  5. Change Management–  Implementing a Design Language System can involve significant changes in processes and tools. A product manager can help manage these changes, ensuring a smooth transition and minimizing disruptions.
  6. Metrics And Measurement– Product managers track and analyze metrics related to the Design Language System’s adoption, usage, and effectiveness. This data-driven approach helps identify areas for improvement and demonstrates the value of the Design Language System to stakeholders.
  7. Scalability–  As your organization grows, a product manager can ensure that the Design Language System scales effectively, addressing the needs of an increasing number of users and projects.
  8. Documentation And Training–  Product managers can oversee the creation of clear, concise documentation and training materials, ensuring that team members can easily access and understand the Design Language System.
  9. Continuous Improvement–  Product managers are adept at iterating on products and systems, ensuring that the Design Language System remains up-to-date and evolves with the needs of the organization and industry.
  10. Budget And Resource Management–  A product manager can help allocate resources efficiently, making the most of your budget and ensuring that the Design Language System’s development stays on track.

These factors not only enhance the viability of the Design Language System from the start – but provide a solid foundation for its enduring influence within your organization.

Closing Thoughts

Working with the client, Product Managers craft a tailored Design Language System strategy that aligns with their unique business objectives, elevates their brand, and fosters a seamless user experience across all their digital products and platforms.

Written by Kaela Coppinger · Categorized: Agile & Lean, Design UX/UI, Learning and Development, Product Development · Tagged: best practices, Components, Design Language Systems, Design Programs, Designers, DLS, learning and growth, product development, Product Management

May 08 2023

InRhythm Presents The Propel Spring Quarterly Summit

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

New York, NY – InRhythm recently concluded its very first Propel Spring Quarterly Summit; a premiere event consisting of six individual coding workshops aimed to support the learning and growth of engineering teams around the world. 

Over the last three weeks, our consulting practices have led a series of interactive experiences that delved into the latest technology trends and tools, designed to propel professionals forward into their careers. 

The workshops are free to access as a unique part of InRhythm’s mission to build a forward-thinking thought leadership annex:

  • InRhythm Propel Spring Quarterly Summit / SDET Workshop / March 17th 2023
  • InRhythm Propel Spring Quarterly Summit / Web Workshop / March 24th 2023
  • InRhythm Propel Spring Quarterly Summit / DevOps Workshop / March 29th 2023
  • InRhythm Propel Spring Quarterly Summit / Android Workshop / April 11th 2023
  • InRhythm Propel Spring Quarterly Summit / Cloud Native Workshop / April 21st 2023
Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

SDET Workshop (03/17/23)

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

This workshop worked as an introduction to writing and running tests using Microsoft Playwright. Our SDET Practice went over Playwright’s extensive feature set before diving more in-depth with its API.  

For the workshop, the team went over setup and installation of the tool, as well as wrote a series of comprehensive tests against a test application. Once tests were run, the team afforded participants the opportunity to go over some of Playwright’s advanced features, such as its powerful debugger and enhanced reporting. 

To close out the workshop, SDET Practice Leadership compared Playwright’s features to some of its competitors, went over its pros and cons, and discussed why they believed it to be a paramount tool to consider for automated testing solutions.

Web Workshop (03/24/23)

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

Our Web Practice focused their workshop on their top three, intertwining technologies for development cycles. 

With many modern web applications sharing many of the responsibilities that a middle layer/presentation and service layer/backend provide to the frontend layer, the project was kicked off by organizing the elements with a mono-repository.  

Once the application moved into its build phase, it was time to accelerate the architecture to the next level using NextJS. 

Web Practice Leadership wrapped their project, with an intuitive overview of web bundling and the variety of methods utilized – in order to best adapt to each individual build.

DevOps Workshop (03/29/23)

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

In this workshop, the DevOps Practice demonstrated tools for provisioning infrastructure as well as how to construct a self-servicing platform for provisioning resources. With these new developments in the industry, bridging the gaps between development and ops by allowing developers to self-manage cloud infrastructure to satisfy their needs will be a paramount skill to adopt. Our DevOps practitioners discussed the pros and cons of a number of tools for provisioning infrastructure and identified which tools can best fit a business’ needs.

For the hands-on interactive session, the team ran through the necessary steps to get started with Pulumi and provision a resource onto AWS, along with demonstrating Terraform in order to get a feel for the difference between the two popular infrastructure-as-code tools. After that, we set up some plugins to enhance the development experience with IaC.  

Self-servicing platforms are the best way to allow for engineers to provision resources and infrastructure for their needs en-masse. With Backstage, the team was able to demonstrate a platform for engineers to come to and fulfill their needs whether it be creating a new microservice, a new repository, or even provisioning a new k8s cluster. Furthermore, the provisioning of these resources were proven to standardize and bring uniformity to ensure that best practices are enforced. Long gone are the days of submitting a ticket to create a new instance to deploy an application, with a wait time of a few hours or even a few days.  Self-servicing tools are the future of bringing operations into the hands of developers and bridging the gap between development and operations.

Finally, DevOps Practice Leadership set up a self-servicing platform and hooked it into the aforementioned IaC repository to allow for the provisioning of resources from a GUI. 

Managing infrastructure can quickly become tedious as the number of resources being used on a cloud provider continue to grow.  With infrastructure-as-code, not only DevOps engineers, but developers can now lay out infrastructure using code. Since it’s managed via code, version-controlling/source-code management tools are also available, making management of infrastructure significantly easier.

iOS Workshop (03/28/23)

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

Our iOS Practice did a full overview of Swift Async/Await for iOS application development

Async/Await is a programming feature that simplifies asynchronous operations by allowing software engineers to write asynchronous code in a synchronous manner. It also makes code easy to read/write, improves performance/responsiveness, and reduces the likelihood of errors.

In short, Async/Await is a powerful modern feature in every avenue from development speed and simplified code to and application performance.

Android Workshop (04/11/23)

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

Our Android Practice performed a comprehensive demonstration of the practical integration of Kotlin Multi-Platform Mobile (KMM) for cross-platform development. 

Kotlin Multi-Platform Mobile is an exciting, growing new technology that allows sharing core code between Android, iOS, and Web.  

In this workshop, Android Practice Leadership explored what KMM was, how to setup a project for KMM, a walkthrough implementing a core module to a few APIs (network layer, data models, parsers, and business logic), and then consumed this core library in an Android (Jetpack Compose) and iOS (SwiftUI) application.

Cloud Native Application Development Workshop (04/21/23)

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

In this workshop our Cloud Native Application Development Practice introduced the participants to gRPC, which is Google’s take on Remote Procedural Calls. Our Practice Leadership presented a brief history of gRPC and Protocol Buffers. Google and other companies use gRPC to serialize data to binary which results in smaller data packets. Throughout the presentation our team went over some of the pros and cons of using gRPC for individual API calls.

In our hands-on workshop portion participants created a simple application to manage users and notes powered by Java, gRPC, and Postgres. The grand finale featured a full-circle moment as we worked together to create a series of CRUD APIs in Java using gRPC to send/receive data packets, translate those into objects, and store them in a database.

About InRhythm

InRhythm is a leading modern product consultancy and digital innovation firm with a mission to make a dent in the digital economy. Founded in 2002, InRhythm is currently engaged by Fortune 50 enterprises and scale-ups to bring their next generation of modern digital products and platforms to market. InRhythm has helped hundreds of teams launch mission-critical products that have created a positive impact worth billions of dollars. The projects we work on literally change the world.

InRhythm’s unique capabilities of Product Innovation and Platform Modernization services are the most sought-after. The InRhythm team of A+ thought leaders don’t just “get a job,” they join the company to do what they love. InRhythm has a “who’s who” clients list and has barely scratched the surface in terms of providing those clients the digital solutions they need to compete. From greenfield to tier-one builds, our clients look to us to deliver their mission-critical projects in the fields of product strategy, design, cloud native applications, as well as mobile and web development. 

Written by Kaela Coppinger · Categorized: Culture, DevOps, Employee Engagement, Events, InRhythm News, InRhythmU, Java Engineering, Learning and Development, Product Development, Software Engineering, Web Engineering · Tagged: Android, best practices, Cloud Native Application Development, devops, INRHYTHMU, ios, JavaScript, learning and growth, Mobile Development, Press Release 2023, Propel, Propel Workshop, SDET, software engineering, Spring Quarterly Propel Summit, Web

Apr 12 2023

Structured Concurrency In Swift

Based on a Lightning Talk by: Joshua Buchanan, Lead iOS Engineer @ InRhythm on March 28th, 2023 as part of the Propel Spring Quarterly Summit 2023

Author: Mike Adams, Senior Technical Writer @ InRhythm

Swift Concurrency

Design Credit: Joel Colletti, Lead UI/UX Designer @ InRhythm

Concurrency is a task-based system that allows developers to take full advantage of the “await” portion of the Async/Await keywords to perform concurrent task execution. An Async/Await task waits until its process finishes before continuing.

Async/Await lets you take advantage of parallelization to make full use of all the available CPU cores to give your users the best user experience. 

Swift Concurrency includes, Async/Await, Tasks, and Task Groups. As you read “Async/Await,” assume that it means the entirety of Swift Concurrency and not simply, Async/Await.

Here are the keywords and concepts we’ll use in discussing Structured Concurrency:

  • Task – That portion of the concurrency framework that creates the concurrent environment. It can throw errors and return values
  • Child Task – A task generated and managed by a Parent Task.The Parent is responsible for task execution
  • Cancellation – In Swift, you can cancel or stop any task from completing. Unlike Combine, structured concurrency does not require a strong reference to emit values from the publisher (i.e., the Task) and continue to run even if you remove references to the publisher. If you don’t want the task to run, you must either cancel or stop it
  • Priorities – Structured Concurrency’s Task Priorities are very similar to Apple’s Quality of Service system. Task Priorities include:
    • High
    • Background
    • Low
    • Medium
    • userInitiated
    • Utility

When using Structured Concurrency in your code, remember that while priority setting in your code tells the system which tasks are most important, those priorities are only a suggestion, not a mandate. 

Async/Await

Async/Await provides the Structured Concurrency that removes the necessity of manually propagating errors and managing cancellation, as well as any other types of concurrency issues (e.g., race conditions). It makes program logic simpler to follow as the methods execute linearly rather than with the back and forth required when using completion handlers. 

Structured concurrency also improves performance and allows for cleaner, more readable code with more precise error handling. In structured concurrency, long-running tasks are self-managing in regard to resources, error propagation, or any concurrency issues. 

Async/Await was first popularized in 2012 via the C# programming language. Between 2012 and 2020, other languages began adopting Async/Await, including but not limited to:

  • Python / Typescript in 2015
  • Kotlin in 2018
  • Rust in 2019
  • C++ in 2020
  • Swift in 2021

Tasks

Although Tasks appear very basic, behind the scenes there is a great deal happening. 

The Task keyword tells the compiler that the code inside the brackets must run in its own area using different rules than the rest of the application. This is the beginning of writing concurrent code in Swift.

In Swift, Tasks check if they were cancelled at appropriate times during execution. If cancelled, the Task begins whatever processing is necessary to cease execution and then responds to the cancellation. Depending on the code, the response could be returning partially finished work, returning an empty collection (or nil), or throwing a cancellation error.

Task Example

The load function shown below displays all the parts of a concurrent function coded as a task.

Child Tasks

Child Tasks are bound to a Parent Task and inherit the Parent Task’s Priority. Parent Tasks can have multiple Child Tasks and a Child Task can be a Parent Task to other Child Tasks.

While Parent Tasks can cancel a Child Task, a Child Task can not cancel their Parent task. Child Tasks begin whatever process is necessary for them to halt once their Parent Task is cancelled. All Child Tasks must finish before the Parent Task can be completed.

Cancellations

Unlike Combine, Tasks in Structure Concurrency will continue to run even when there are no Subscribers. Tasks run until they are completed or until you cancel them in code or programmatically. Cancellations are not determined by strong reference.

Tasks “know” whether they’ve been canceled and you can explicitly cancel a Task. You can also use the Task.checkCancellation() call to check if a Task was cancelled.

There are a number ways to programmatically cancel a Task including:

  • Navigating away from a view where the task was triggered
  • Canceling that Task’s Parent Task to cancel all of its Child Tasks
  • When another Child Task of the same Parent throws an Error

Async Let

Async Let is a variation of Async/Await that differs from the Await version, in that it will immediately launch a known number of Tasks in parallel and manage them in a slightly different manner than Async/Await. Where an Async/Await call suspends the Parent Task during Child Task execution, the Async Let call allows the Parent Task to continue running normally. 

You would use Async Let when you’re certain that the Async code can run independently. Note that unlike a regular Async/Await Call, you cannot directly cancel Async Let calls.

A further difference is that you can only use Async Let in local declarations, not at the top level.

Use Async Let when you need the results from the call later in your application, not immediately. For example, you could use multiple Async Let calls to load gallery images without blocking the main thread, thereby allowing the user to continue using the application’s GUI while the images load. 

Use Async Let when:

  • You have enough detail to request the information you need prior to making the call 
  • The calls do not depend on another call’s results 
  • You are returning different kinds of data
  • The order in which the app returns results is unimportant

Task Groups

Task Groups allow you to combine an unknown number of parallel Child Task calls that return the same Type of data into a batch, and then wait until the last Child Task finishes before completing the call. This is most useful when the results are a consistent type, such as when combining API responses into a single object. Task Groups only complete after all Child Tasks in the Task Group are complete.

It is important to never mutate the Task Group using code from outside the Task where the Task Group was created. Doing so interleaves data obtained by the Task Group with the data from outside the Task Group which leaves the results inconsistent. 

Using Try Await allows you to handle any potential thrown errors in the grouped call using additional code.

For example, let’s say you have a function that returns a string value and you need to call the function n times. Each time that function returns, you want to append the resultant string to an array of strings:  

Once all the Tasks in the Task Group are complete, you want the Task Group to return a String array. The “of” type for the Task Group is String because the result of the parallel task is a String and the returning type is an array of Strings

Coding UIImages in Task Groups will appear more familiar. For example, let’s say that you have a list of indeterminate size composed of URLs that point to specific images, and a function that downloads an image from each of those URLs and then adds it to an image array returned from the Task Group.

In this case, the “of” type for your Task Group is UIImage, and because the parallel function inside the task is downloading UIImage data, and the returning type for the Task Group is an array of UIImages.

Task Group Example

The Of type for this example Task Group scenario is UIImage and because the parallel function inside the task is downloading UIImage data, the “returning” type of the task group is an array of UIImages.

There are two things happening in this example code. The first is the execution of the parallel downloading task for the individual images located at each URL. The second takes the results from the previous task (the UIIMage) and combines them into a single array of images.

Resources

  • Apple Developer: Getting Started with Swift Concurrency
  • InRhythm Swift Lightning Talk (Deck): Structured Concurrency in Swift
  • Linkedin Video: InRhythm Propel Workshop (Video) 
  • GitHub Repo: Async Await Propel Workshop GitHub Repo 
  • Blog, Antoine van der Lee: Async await in Swift explained with code examples

Written by Mike Adams · Categorized: Code Lounge, InRhythmU, Learning and Development, Product Development, Software Engineering · Tagged: Async Await, best practices, INRHYTHMU, ios, iOS Workshop, learning and growth, Mobile App Development, Mobile Development, Mobile Engineering, Propel Spring Quarterly Summit 2023, software engineering, SwiftUI, ux

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 10
  • Go to Next Page »

Footer

Interested in learning more?
Connect with Us
InRhythm

110 William St
Suite 2601
New York, NY 10038

1 800 683 7813
get@inrhythm.com

Copyright © 2023 · InRhythm on Genesis Framework · WordPress · Log in

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT