Skip to content

Instantly share code, notes, and snippets.

@sirolf2009
Last active November 8, 2018 13:14
Show Gist options
  • Save sirolf2009/310dc61710cc4140f5b11211c6e9fcb7 to your computer and use it in GitHub Desktop.
Save sirolf2009/310dc61710cc4140f5b11211c6e9fcb7 to your computer and use it in GitHub Desktop.
muse scrapbook
/**
* DESIGN PATTERN
*/
public class JobManager {
final BlockingQueue<? extends JobExecution> persistLastRun = new LinkedBlockingQueue<>();
private JobManager() {
final Thread persistLastRunThread = new Thread(() -> {
while(true) {
try {
registerInZookeeper(persistLastRun.take());
} catch(final Throwable e) {
log.error("Failed to persist a last run in zookeeper", e);
}
}
}, "Zookeeper Last Run Thread");
}
private void registerInZookeeper(JobExecution execution) throws MalformedURLException, IOException {
zooguard.write("/cassandra/jobs/" + execution.getClass().getSimpleName() + "/" + execution.getJob().getParameterHashcode(), execution.getObjectId().toString());
}
}
println('''strokeText(«char.toString()», «column»*«charWidth», «lineInScreen»*«charHeight»)''')
println('''strokeText(«char.toString()», «column*charWidth», «lineInScreen*charHeight»)''')
strokeText(char.toString(), column*charWidth, lineInScreen*charHeight)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment