Concurrency Basics
Client and Server Files
A larger program often splits responsibilities across source files. In this replay, one execution starts in the order application, jumps into the price service, then returns with the computed result.
One Execution Across Files
OrderApp.java
public class OrderApp {
public static void main(String[] args) {
int quantity = ;
int unitPrice = 15;
int total = PriceService.total(unitPrice, quantity);
System.out.println("total=" + total);
}
}
public class OrderApp {
public static void main(String[] args) {
int quantity = ;
int unitPrice = 15;
int total = PriceService.total(unitPrice, quantity);
System.out.println("total=" + total);
}
}
public class OrderApp {
public static void main(String[] args) {
int quantity = ;
int unitPrice = 15;
int total = PriceService.total(unitPrice, quantity);
System.out.println("total=" + total);
}
}
request
A request is a small data object passed from a client-side part of a program to a server-side part.
response
A response is the result returned by the server-side part.