File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ To get the latest stable release omit `@next` part altogether or use `@latest` i
31
31
``` javascript
32
32
var neo4j = require (' neo4j-driver' ).v1 ;
33
33
```
34
+ Driver instance should be closed when Node.js application exits:
35
+
36
+ ``` javascript
37
+ driver .close ();
38
+ ```
39
+
40
+ otherwise application shutdown might hang or it might exit with a non-zero exit code.
34
41
35
42
## Include in web browser
36
43
@@ -46,6 +53,14 @@ This will make a global `neo4j` object available, where you can access the `v1`
46
53
var driver = neo4j .driver (" bolt://localhost" , neo4j .auth .basic (" neo4j" , " neo4j" ));
47
54
```
48
55
56
+ It is not required to explicitly close the driver on a web page. Web browser should gracefully close all open
57
+ WebSockets when the page is unloaded. However, driver instance should be explicitly closed when it's lifetime
58
+ is not the same as the lifetime of the web page:
59
+
60
+ ``` javascript
61
+ driver .close ();
62
+ ```
63
+
49
64
## Usage examples
50
65
51
66
``` javascript
You can’t perform that action at this time.
0 commit comments