-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add reactive/INTRODUCTION_EN.md #41
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos to fix. Good translation otherwise.
I like exploding things, so we'll talk about a cannon. | ||
Don't worry about the `(x)` right now, you will understand them later on… | ||
|
||
Let's suppose you happily go to Wallmart to buy a cannon. It's a high-tech cannon that can automagically recharge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Walmart company has only one "L" in its name
Let's suppose you happily go to Wallmart to buy a cannon. It's a high-tech cannon that can automagically recharge. | |
Let's suppose you happily go to Walmart to buy a cannon. It's a high-tech cannon that can automagically recharge. |
|
||
## An explanation to rekindle lost hopes | ||
|
||
Looks like you have a bad karma, because I am gonna be mean~. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it's a typo
Looks like you have a bad karma, because I am gonna be mean~. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?) | |
Looks like you have a bad karma, because I am gonna be mean. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?) |
Don't worry about the `(x)` right now, you will understand them later on… | ||
|
||
Let's suppose you happily go to Wallmart to buy a cannon. It's a high-tech cannon that can automagically recharge. | ||
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuses batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuses batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss. | |
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuse batches, and `(3)` fire as many fuses as you want to throw cannonballs on your boss. |
or
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuses batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss. | |
With your newfound super-duper cannon, you go back and `(1)` install it on a hill (locking on your boss), `(2)` gets the fuse batch, and `(3)` fire as many fuses as you want to throw cannonballs on your boss. |
- You don't even know whether the cannon will throw enough cannonballs to match your explosion desires (Has it enough ammunition? Will it explode halfway?) | ||
- You hate your boss enough that you decided to dance whenever the cannon throws a cannonball. | ||
- You somehow decided to run if the cannon explodes. Thanks, Captain Obvious. | ||
- You have decided to go on strike if your boss is still dead and you are running out of cannonballs. And if the cannon hasn't exploded, otherwise you would have fled too far~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A typo supposedly + no-sense
- You have decided to go on strike if your boss is still dead and you are running out of cannonballs. And if the cannon hasn't exploded, otherwise you would have fled too far~ | |
- You have decided to go on strike if your boss is still alive and you are running out of cannonballs. And if the cannon hasn't exploded, otherwise you would have fled too far. |
// I didn't declare a lot of things, we are doing pseudocode here | ||
interface Me { | ||
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses. | ||
// Just because it's the future. | ||
void onPrepare(FuseBatch fuses); | ||
|
||
// This is called whenever the cannon launches a cannonball toward your patron. | ||
default void onNext(CannonBall ball) { | ||
dance(); | ||
} | ||
|
||
// This is called when the cannon of the future throws an uncaught runtime exception and explodes. | ||
// Yes, the futuuuuuuuure still has runtime exceptions :'c | ||
default void onError(Throwable t) { | ||
runForYourLife(); | ||
} | ||
|
||
// This is called when the cannon has no cannonball left to fire. | ||
default void onComplete() { | ||
if (boss.isAliveAndKicking()) | ||
timeToGoOnStrike(); | ||
} | ||
} | ||
|
||
interface FuseBatch { | ||
// We kindly ask the cannon to launch `fuseAmount` cannonballs by firing as many fuses. | ||
void fire(long fuseAmount); | ||
|
||
// If you suddendly remember the inherent kindness of your boss, stow your cannon and try to cancel the cannonballs' throwing. | ||
// You might miss some fuses though, trampling on them isn't exactly a precise method. | ||
void cancel(); | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird alternance tab/space
// I didn't declare a lot of things, we are doing pseudocode here | |
interface Me { | |
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses. | |
// Just because it's the future. | |
void onPrepare(FuseBatch fuses); | |
// This is called whenever the cannon launches a cannonball toward your patron. | |
default void onNext(CannonBall ball) { | |
dance(); | |
} | |
// This is called when the cannon of the future throws an uncaught runtime exception and explodes. | |
// Yes, the futuuuuuuuure still has runtime exceptions :'c | |
default void onError(Throwable t) { | |
runForYourLife(); | |
} | |
// This is called when the cannon has no cannonball left to fire. | |
default void onComplete() { | |
if (boss.isAliveAndKicking()) | |
timeToGoOnStrike(); | |
} | |
} | |
interface FuseBatch { | |
// We kindly ask the cannon to launch `fuseAmount` cannonballs by firing as many fuses. | |
void fire(long fuseAmount); | |
// If you suddendly remember the inherent kindness of your boss, stow your cannon and try to cancel the cannonballs' throwing. | |
// You might miss some fuses though, trampling on them isn't exactly a precise method. | |
void cancel(); | |
} | |
``` | |
// I didn't declare a lot of things, we are doing pseudocode here | |
interface Me { | |
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses. | |
// Just because it's the future. | |
void onPrepare(FuseBatch fuses); | |
// This is called whenever the cannon launches a cannonball toward your patron. | |
default void onNext(CannonBall ball) { | |
dance(); | |
} | |
// This is called when the cannon of the future throws an uncaught runtime exception and explodes. | |
// Yes, the futuuuuuuuure still has runtime exceptions :'c | |
default void onError(Throwable t) { | |
runForYourLife(); | |
} | |
// This is called when the cannon has no cannonball left to fire. | |
default void onComplete() { | |
if (boss.isAliveAndKicking()) | |
timeToGoOnStrike(); | |
} | |
} | |
interface FuseBatch { | |
// We kindly ask the cannon to launch `fuseAmount` cannonballs by firing as many fuses. | |
void fire(long fuseAmount); | |
// If you suddendly remember the inherent kindness of your boss, stow your cannon and try to cancel the cannonballs' throwing. | |
// You might miss some fuses though, trampling on them isn't exactly a precise method. | |
void cancel(); | |
} |
|
||
```java | ||
interface Publisher<T> { | ||
// We prepare the subscription, this might take some time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced space by tab
// We prepare the subscription, this might take some time | |
// We prepare the subscription, this might take some time |
// • If the cumulated demand overflow the long max number, it can treat it as unbound, effectively turning into a hot source. | ||
// (We'll see what this means in later sheets) | ||
// • If the Publisher completes (cannot generate anymore element) or errors (sad life), it will call the related method then stop ANY further emission. | ||
void request(long elementAmount); | ||
|
||
// Asks the Publisher to cancel the subscription, that is to stop emitting elements. | ||
// Previous pending requests might still be met. | ||
void cancel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird alternance space/tab
// • If the cumulated demand overflow the long max number, it can treat it as unbound, effectively turning into a hot source. | |
// (We'll see what this means in later sheets) | |
// • If the Publisher completes (cannot generate anymore element) or errors (sad life), it will call the related method then stop ANY further emission. | |
void request(long elementAmount); | |
// Asks the Publisher to cancel the subscription, that is to stop emitting elements. | |
// Previous pending requests might still be met. | |
void cancel(); | |
// • If the cumulated demand overflow the long max number, it can treat it as unbound, effectively turning into a hot source. | |
// (We'll see what this means in later sheets) | |
// • If the Publisher completes (cannot generate anymore element) or errors (sad life), it will call the related method then stop ANY further emission. | |
void request(long elementAmount); | |
// Asks the Publisher to cancel the subscription, that is to stop emitting elements. | |
// Previous pending requests might still be met. | |
void cancel(); |
|
||
With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive sheet, progress cannot be halted) | ||
|
||
Let's stop there for a very small peek into reactive programming, I pray that your imagination run wild on its capabilities~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo I think
Let's stop there for a very small peek into reactive programming, I pray that your imagination run wild on its capabilities~ | |
Let's stop there for a very small peek into reactive programming, I pray that your imagination run wild on its capabilities |
|
||
## Definition | ||
|
||
The original article has the [french](https://fr.wikipedia.org/wiki/Programmation_r%C3%A9active) definition as well, but seeing as it is quite useless I just removed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original article has the [french](https://fr.wikipedia.org/wiki/Programmation_r%C3%A9active) definition as well, but seeing as it is quite useless I just removed it. | |
The original article has the [french](https://fr.wikipedia.org/wiki/Programmation_r%C3%A9active) definition as well, but after judging that it was quite irrelevant, I just removed it. |
Couldn't quite understand the but seeing as it is quite useless
, I suggested an alternative
> With this paradigm it is possible to express static (e.g., arrays) or dynamic (e.g., event emitters) data streams with ease, and also communicate that an inferred dependency | ||
> within the associated execution model exists, which facilitates the automatic propagation of the changed data flow. | ||
|
||
Wow, that's a lot of cool and complicated words! Don't worry, at this point not feeling overwhelmed would be concerning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that's a lot of cool and complicated words! Don't worry, at this point not feeling overwhelmed would be concerning. | |
Wow, that's a lot of cool and complicated words! Don't worry, at this point no overwhelming feeling would be concerning. |
|
||
> Haha, I do not fear *anything*! A Publisher is something that publish other things, no? | ||
|
||
**EXACT!** Or rather, a Publisher emits things. A Publisher emits values, but specially so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**EXACT!** Or rather, a Publisher emits things. A Publisher emits values, but specially so. | |
**EXACTLY!** Or rather, a Publisher emits things. A Publisher emits values but in a particular way. |
> within the associated execution model exists, which facilitates the automatic propagation of the changed data flow. | ||
|
||
Wow, that's a lot of cool and complicated words! Don't worry, at this point not feeling overwhelmed would be concerning. | ||
(Or it just means you actually don't need this introduction at all so stop reading it and do something useful with your life) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a big fan of light tone and jokes in articles, but I think this "and do something useful with your life" is kind of too much, unnecessary.
|
||
Looks like you have a bad karma, because I am gonna be mean~. So mean that I'll use complicated words right away: `Publisher`! (Are you fearing me now?) | ||
|
||
> Haha, I do not fear *anything*! A Publisher is something that publish other things, no? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Haha, I do not fear *anything*! A Publisher is something that publish other things, no? | |
> Haha, I do not fear *anything*! A Publisher is something that publishes other things, no? |
|
||
// I didn't declare a lot of things, we are doing pseudocode here | ||
interface Me { | ||
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// When the cannon finished it's installation, it will notify us and we get an infinite batch of fuses. | |
// When the cannon finished its installation, it will notify us and we get an infinite batch of fuses. |
``` | ||
|
||
Well now that's done, we don't have anything else to do with our cannon. | ||
So let's haphazardly pick some code from [reactive-streams](http://www.reactive-streams.org/) since it should be related to the official topic of this sheet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let's haphazardly pick some code from [reactive-streams](http://www.reactive-streams.org/) since it should be related to the official topic of this sheet. | |
So let's haphazardly pick some code from [reactive-streams](http://www.reactive-streams.org/) since it should be related to the official topic of this article. |
1. We order a subscription on Amazon Prime. | ||
1. We get the tailored subscription; note that it makes no sense for a person to have multiple subscriptions. | ||
1. We use the subscription to request objects to Amazon. | ||
1. These values will get there, eventually. And later. And might not arrive at all but usually they do (or I at least hope so). Amazon might even find itself out of stock! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. These values will get there, eventually. And later. And might not arrive at all but usually they do (or I at least hope so). Amazon might even find itself out of stock! | |
1. These values will get there, eventually. And later. And might not arrive at all but usually, they do (or I at least hope so). Amazon might even find itself to be out of stock! |
1. We use the subscription to request objects to Amazon. | ||
1. These values will get there, eventually. And later. And might not arrive at all but usually they do (or I at least hope so). Amazon might even find itself out of stock! | ||
|
||
With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive sheet, progress cannot be halted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive sheet, progress cannot be halted) | |
With this awesome list written by the great and humble me, you ought to understand the lil `(x)` scattered up there! (a retroactive article, progress cannot be halted) |
|
||
# Reactive Programming 🇪🇳 | ||
|
||
This course is concerned about the reactive paradigm and its uses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This course is concerned about the reactive paradigm and its uses. | |
This course focuses on the reactive paradigm and its uses. |
the former formulation sounded pretty deprecated to me
Translate reactive/INTRODUCTION_FR.md to english