-
Notifications
You must be signed in to change notification settings - Fork 22
/
thread_lenderLoans.js
33 lines (27 loc) · 947 Bytes
/
thread_lenderLoans.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use strict"
/**
* an attempt at having this executed in a thread.
*/
console.log('started thread file')
//self.importScripts('./react/src/scripts/api/kivajs/LenderFundraisingLoans.js')
function lenderLoans(lender_id){
const LFL = require('./react/src/scripts/api/kivajs/LenderFundraisingLoans')
console.log('required LFL', typeof LFL)
//var LenderFundraisingLoans = require('./react/src/scripts/api/kiva').LenderFundraisingLoans
console.log("type of ", typeof LFL)
thread.emit("data", 'processed', {lender_id:lender_id})
return "BOOK"
}
/**
onmessage = function(event) {
console.log('thread started',event.data)
postMessage("foofof:" + event.data)
/**
new LenderFundraisingLoans(event.data).ids()
.done(ids => {
console.log('done:',ids)
postMessage(JSON.stringify({status:200, ids: ids}))
})
.fail(x=>postMessage(JSON.stringify({status: 404})))
}
**/