Java Code Examples for java.util.concurrent.Flow.Subscription#request()

The following examples show how to use java.util.concurrent.Flow.Subscription#request() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Lesson4.java    From Java-Concurrency-Multithreading-in-Practice with MIT License 5 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	System.out.println(name + " subscribed!");
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 2
Source File: Lesson4.java    From Java-Concurrency-Multithreading-in-Practice with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	System.out.println(name + " subscribed!");
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 3
Source File: Lesson3.java    From Java-Concurrency-Multithreading-in-Practice with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	System.out.println(name + " subscribed!");
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 4
Source File: Lesson3.java    From Java-Concurrency-Multithreading-in-Practice with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	System.out.println(name + " subscribed!");
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 5
Source File: ProgMainReactiveStreams.java    From javase with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
  System.out.printf("new subscription %s\n", subscription);
  this.subscription = subscription;
  subscription.request(1);
}
 
Example 6
Source File: ProgMainReactiveStreamsWithProcessor.java    From javase with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 7
Source File: UsersSubscriberReactStream.java    From javase with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	System.out.printf("onSubscribe(...) - new subscription %s\n", subscription);
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 8
Source File: ProgMainReactiveStreams.java    From javase with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
  System.out.printf("new subscription %s\n", subscription);
  this.subscription = subscription;
  subscription.request(1);
}
 
Example 9
Source File: WelcomeProcessor.java    From Reactive-Programming-With-Java-9 with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	// Request an unbounded number of items
	subscription.request(Long.MAX_VALUE);
	// Long.MAX_VALUE is considered as unbounded 
}
 
Example 10
Source File: WelcomeSubscriber.java    From Reactive-Programming-With-Java-9 with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	this.subscription = subscription;
	System.out.printf(Thread.currentThread().getName()+" subscribed with max count %d\n", maxCount);
	subscription.request(maxCount);
}
 
Example 11
Source File: MyProcessor.java    From journaldev with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
	this.subscription = subscription;
	subscription.request(1);
}
 
Example 12
Source File: BaeldungSubscriberImpl.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
    this.subscription = subscription;
    subscription.request(1);
}
 
Example 13
Source File: BaeldungBatchSubscriberImpl.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
    this.subscription = subscription;
    subscription.request(BUFFER_SIZE);
}
 
Example 14
Source File: EndSubscriber.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void onSubscribe(Subscription subscription) {
    this.subscription = subscription;
    subscription.request(1);
}