in java/amazon-kinesis-producer/src/main/java/com/amazonaws/services/kinesis/producer/Daemon.java [284:338]
private void startLoops() {
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
sendMessage();
}
}
});
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
receiveMessage();
}
}
});
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
returnMessage();
}
}
});
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
try {
updateCredentials();
} catch (InterruptedException e) {
//
// If interrupted it's likely the KPL is shutting down. So clear the
// interrupted status and allow the loop to continue.
//
} catch (RuntimeException re) {
log.error(
"Caught runtime exception while updating credentials. Will retry after refresh delay",
re);
}
try {
Thread.sleep(config.getCredentialsRefreshDelay());
} catch (InterruptedException ie) {
//
// Same as above it's likely safe to ignore this as the KPL is probably shutting down.
//
}
}
}
});
}