Skip to content

Commit 0d695ac

Browse files
Explicitly call out that reuse is not implemented yet. (#173)
* Explicitly call out that reuse is not implemented yet. * Fix incorrect Engine documentation Co-authored-by: Luke Bordonaro <lukebo@microsoft.com>
1 parent 3bf0253 commit 0d695ac

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

documentation/Using-the-SDK/Using-the-engine.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ processed by an `Engine` instance. The `DataSourceSet` will reference a
3939
`DataSourceSet` are able to be processed.
4040

4141
````cs
42-
using var plugins = PluginSet.Load();
43-
using var dataSources = DataSourceSet.Create(plugins);
44-
45-
dataSources.AddDataSource(new FileDataSource("myfile.txt"));
46-
dataSources.AddDataSource(new FileDataSource("yourfile.txt"));
42+
using (var plugins = PluginSet.Load())
43+
{
44+
using (var dataSources = DataSourceSet.Create(plugins))
45+
{
46+
dataSources.AddDataSource(new FileDataSource("myfile.txt"));
47+
dataSources.AddDataSource(new FileDataSource("yourfile.txt"));
4748

48-
// ... and so on
49+
// ... and so on
50+
}
51+
}
4952

5053
````
5154

@@ -69,7 +72,7 @@ to pass `false` will be added in a future update.
6972
````cs
7073
using (var plugins1 = PluginSet.Load())
7174
{
72-
using (var dataSources = DataSourceSet.Create(plugins, true))
75+
using (var dataSources = DataSourceSet.Create(plugins1, true))
7376
{
7477
}
7578

@@ -82,9 +85,16 @@ using (var plugins1 = PluginSet.Load())
8285
In order to use the `Engine`, you must first load your plugins and data sources.
8386
Once you have done so, you may use the `Create` method with an `EngineCreateInfo`
8487
instance in order to create a useable `Engine.` Similar to how the `DataSourceSet`
85-
can take ownership of the `PluginSet`, the `Engine` takes ownership of the
86-
`DataSourceSet`. Set the `OwnsDataSources` property on the `EngineCreateInfo`
87-
instance to suppress this behavior.
88+
can take ownership of the `PluginSet`, the `Engine` can take ownership of
89+
data sources. The `Engine` will take ownership of and safely dispose of any
90+
`IDataSource` instances passed to its static `Create` methods. More concretely,
91+
an `Engine` created by calling either
92+
- `Create(IDataSource, Type)`
93+
- `Create(IEnumerable<IDataSource>, Type)`
94+
95+
will take ownership of the data source(s) passed in as the first parameter. **To
96+
suppress this behavior, you must use the `Create(EngineCreateInfo)` method**.
97+
8898
Once your `Engine` has been created, you can enable cookers and tables to
8999
participate in processing. If an attempt is made to enable a cooker for which
90100
there is no corresponding data source in the `DataSourceSet`, then an exception
@@ -108,3 +118,10 @@ using (var dataSources = DataSourceSet.Create(plugins))
108118
}
109119
````
110120

121+
# Reusing the DataSourceSet - Coming Soon
122+
123+
We have plans for the future to enable reusing the `DataSourceSet` and `PluginSet`
124+
across `Engine` instances. However, this functionality has not been fully implemented.
125+
Thus, at this time, it is not supported to create a new `Engine` reusing a `DataSourceSet`.
126+
Once you have finished using an `Engine` instance, you should dispose the corresponding
127+
`DataSourceSet` and `PluginSet`

0 commit comments

Comments
 (0)