rets-client
Advanced tools
Comparing version 4.1.1 to 4.1.2
{ | ||
"name": "rets-client", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "A RETS client (Real Estate Transaction Standard).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -211,2 +211,11 @@ rets-client | ||
var Promise = require('bluebird'); | ||
// this function doesn't do much, it's just a placeholder for whatever you want to do with the results | ||
var doAsyncProcessing = function (row, index, callback) { | ||
console.log("-------- Result " + index + " --------"); | ||
outputFields(row); | ||
// must be sure callback is called when this is done | ||
callback(); | ||
} | ||
// establish connection to RETS server which auto-logs out when we're done | ||
@@ -217,2 +226,6 @@ rets.getAutoLogoutClient(clientSettings, function (client) { | ||
return new Promise(function (resolve, reject) { | ||
console.log("===================================="); | ||
console.log("======== Streamed Results ========"); | ||
console.log("===================================="); | ||
var count = 0; | ||
var retsStream = client.search.stream.query("OpenHouse", "OPENHOUSE", "(OpenHouseType=PUBLIC),(ActiveYN=1)", {limit:100, offset:10}); | ||
@@ -224,3 +237,4 @@ var processorStream = through2.obj(function (event, encoding, callback) { | ||
// make sure callback is called only when all processing is complete | ||
doAsyncProcessing(event.payload, callback); | ||
count++; | ||
doAsyncProcessing(event.payload, count, callback); | ||
break; | ||
@@ -227,0 +241,0 @@ case 'done': |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82721
310