• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Is reactive programming java's way of asynchrous programming?

 
Ranch Foreman
Posts: 2891
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to understand reactive programming in Java. Is reactive programming java's way of asynchronous programming? Thanks
 
Marshal
Posts: 78698
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica Shiralkar wrote:. . . Is reactive programming java's way of asynchronous programming? Thanks

No. You can do asynchronous programming with ordinary multi‑threading.

Not a “beginning” question: moving you to a more appropriate forum.
 
Saloon Keeper
Posts: 15276
350
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Be careful, asynchronous doesn't imply concurrent.

Asynchronous programming is a style that it is characterized by passing callbacks to higher order functions. The callback may be called directly or at a later time. It may be called by the same thread or by a different one.

Concurrent programming usually requires an asynchronous style. But there are examples of asynchronous code that have nothing to do with concurrency: executing a sequential Stream is such an example.

I believe reactive programming also heavily depends on asynchronous programming, but it has a specific purpose: it's a way of handling push-based data streams by reacting to data as it enters the application. This can happen in a completely sequential manner, so concurrent threads may not be necessary. Asynchronous programming is still a useful way of reacting to events in such a way.

So no, reactive programming doesn't bring asynchronous programming to Java. It's asynchronous programming that's already available in Java that allows for reactive programming.
 
Monica Shiralkar
Ranch Foreman
Posts: 2891
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:
reactive programming doesn't bring asynchronous programming to Java. It's asynchronous programming that's already available in Java that allows for reactive programming.


Thanks
 
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic