You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ReadMe.md
+44-26
Original file line number
Diff line number
Diff line change
@@ -358,6 +358,11 @@ The next two sections list all available options.
358
358
| NumRetries |`int`| The number of times an invocation is retried. If set to a negative value, invocations are retried indefinitely. If the module source of an invocation is an unseekable stream, the invocation isn't retried. If you require retries for such streams, copy their contents to a `MemoryStream`.|`1`|
359
359
| Concurrency |`Concurrency`| The concurrency mode for invocations.<br><br>By default, this value is `Concurrency.None` and invocations are executed synchronously by a single NodeJS process; mode pros: lower memory overhead and supports all modules, cons: less performant.<br><br>If this value is `Concurrency.MultiProcess`, `ConcurrencyDegree` NodeJS processes are created and invocations are distributed among them using round-robin load balancing; mode pros: more performant, cons: higher memory overhead and doesn't work with modules that have persistent state. |`Concurrency.None`|
360
360
| ConcurrencyDegree |`int`| The concurrency degree. If `Concurrency` is `Concurrency.MultiProcess`, this value is the number of NodeJS processes. If this value is less than or equal to 0, concurrency degree is the number of logical processors the current machine has. This value does nothing if `Concurrency` is `Concurrency.None`. |`0`|
361
+
| EnableFileWatching |`bool`| The value specifying whether file watching is enabled. If this value is true, file watching is enabled. Otherwise, it's disabled. If file watching is enabled, when a file in `WatchPath` changes, if its name matches a pattern in `WatchFileNamePatterns`, NodeJS is restarted. |`0`|
362
+
| WatchPath |`string`| The path of the directory to watch for file changes. If this value is `null`, the path `NodeJSProcessOptions.ProjectPath` is watched. This value does nothing if `EnableFileWatching` is `false`. |`null`|
363
+
| WatchSubdirectories |`bool`| The value specifying whether to watch subdirectories of `WatchPath`. If this value is true, subdirectories are watched. Otherwise they aren't. This value does nothing if `EnableFileWatching` is `false`. |`true`|
364
+
| WatchFileNamePatterns |`IEnumerable<string>`| The file name patterns to watch. In a pattern, "*" represents 0 or more of any character and "?" represents 0 or 1 of any character. For example, "TestFile1.js" matches the pattern "*File?.js". This value does nothing if `EnableFileWatching` is `false`. |`["*.js", "*.jsx", "*.ts", "*.tsx", "*.json", "*.html"]`|
365
+
| WatchGracefulShutdown | `bool` | The value specifying whether NodeJS processes shutdown gracefully when a file changes. If this value is true, NodeJS processes shutdown gracefully. Otherwise they're killed immediately.<br><br>What does graceful shutdown mean? When a file changes, a new NodeJS process is created and subsequent invocations are sent to it. The old NodeJS process might still be handling earlier invocations. If graceful shutdown is enabled, the old NodeJS process is killed after its invocations complete. If graceful shutdown is disabled, the old NodeJS process is killed immediately and invocations are retried in the new NodeJS process if retries remain (see `NumRetries`).<br><br>Should I use graceful shutdown? Shutting down gracefully is safer: chances of an invocation exhausting retries and failing is lower, also, you won't face issues from an invocation terminating midway. However, graceful shutdown does incur a tiny performance cost and invocations complete using the outdated version of your script. Weigh these factors for your script and use-case to decide whether to use graceful shutdown. This value does nothing if `EnableFileWatching` is `false`. | `true` |
361
366
362
367
### Debugging Javascript
363
368
These are the steps for debugging javascript invoked using INodeJSService:
@@ -788,15 +793,14 @@ This library is heavily inspired by [Microsoft.AspNetCore.NodeServices](https://
0 commit comments