• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

Differences between async vs. reactive ?  RSS feed

Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What are the differences between async vs. reactive ?

Saloon Keeper
Posts: 10136
  • 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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!