|
@@ -0,0 +1,23 @@
|
|
1
|
+public class MessageLogger implements Runnable{
|
|
2
|
+ private User user;
|
|
3
|
+ private YouAreEll webber;
|
|
4
|
+
|
|
5
|
+ public MessageLogger(User user, YouAreEll webber) {
|
|
6
|
+ this.user = user;
|
|
7
|
+ this.webber = webber;
|
|
8
|
+ }
|
|
9
|
+
|
|
10
|
+ public void run() {
|
|
11
|
+ String results = webber.get_messages(user);
|
|
12
|
+ simulateLag();
|
|
13
|
+ SimpleShell.prettyPrintMessages(results);
|
|
14
|
+ }
|
|
15
|
+
|
|
16
|
+ private void simulateLag() {
|
|
17
|
+ try {
|
|
18
|
+ Thread.sleep(10000);
|
|
19
|
+ } catch (InterruptedException e){
|
|
20
|
+ e.printStackTrace();
|
|
21
|
+ }
|
|
22
|
+ }
|
|
23
|
+}
|