Skip to content

Commit d05d0f4

Browse files
committed
Doc - using the 'close' event to close the client
hmalphettes#3
1 parent f85262c commit d05d0f4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ when all the data has been written and flushed to Elasticsearch.
3636
Listening to `finish` does not mean much really as we are in this situation:
3737
https://github.com/joyent/node/issues/5315#issuecomment-16670354
3838

39+
For example to close the ES client as soon as we are done:
40+
41+
```
42+
ws.on('close', function () {
43+
client.close();
44+
});
45+
```
46+
3947
## Stream search results from Elasticsearch
4048
```
4149
var ReadableSearch = require('elasticsearch-streams').ReadableSearch;
@@ -141,7 +149,7 @@ rs.pipe(ts).pipe(ws).on('finish', onFinish);
141149
# LICENSE
142150
elasticsearch-streams is freely distributable under the terms of the MIT license.
143151

144-
Copyright (c) 2014 Sutoiku, Inc.
152+
Copyright (c) 2015 Sutoiku, Inc.
145153

146154
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
147155
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the

0 commit comments

Comments
 (0)