View gist:1ab7fe916db7a3b566b4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.maximf | |
object P50 { | |
def main(args: Array[String]) { | |
println(go(1000000)) | |
} | |
def go(limit: Long): Long = { | |
val primes = Primes.below(limit).toArray | |
val set = primes.toSet |
View job.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class JobQueue { | |
constructor(collection, identifier, pendingJobs, queuedJobs) { | |
this.collection = collection; | |
this.identifier = identifier; | |
const context = { | |
queue: [], | |
pendingJobs: pendingJobs, | |
queuedJobs: queuedJobs |
View job-constructor-function.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function JobQueue(collection, identifier, pendingJobs, queuedJobs) { | |
const queue = []; | |
this.collection = collection; | |
this.identifier = identifier; | |
this.enqueue = jobDescription => { | |
log.debug(`QUEUE - queue: ${jobDescription}`); | |
const queueEmpty = this.isEmpty(); |
View job-all-public.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class JobQueue { | |
constructor(collection, identifier, pendingJobs, queuedJobs) { | |
this.collection = collection; | |
this.identifier = identifier; | |
// All public, do not care about incapsulation | |
this.queue = []; | |
this.pendingJobs = pendingJobs; | |
this.queuedJobs = queuedJobs; |