• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

Differences between async vs. reactive ?

Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What are the differences between async vs. reactive ?

Saloon Keeper
Posts: 12481
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to assume that by "async" you mean asynchronous programming, and by "reactive" you mean reactive programming, and you're not referring to any specific technologies.

Reactive programming is a form of asynchronous programming. Asynchronous programming just means that you're writing code that will not be executed immediately, as in imperative programming, but at "some point in the future".

Reactive programming is characterized by the execution of the asynchronous code being triggered by the arrival of data to execute on. Data arrives regardless of whether the code is ready to process it. It is "pushed" into the application.

Reactive programming is "push-based". The opposite is "pull-based". Pull-based code doesn't react to data arriving, instead, it gets ready to process data and only then does it ask for data.

What style of programming is more natural to use depends on whether your data source is active or passive. An active data source supplies data regardless of whether there is anything ready to read it. A passive data source does nothing, and only supplies data when you ask for it.
Our first order of business must be this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic