@fluidframework/local-driver Package
Interfaces
| Interface | Alerts | Modifiers | Description |
|---|---|---|---|
| EphemeralService | Alpha | sealed | An in-memory Fluid service that can produce connected EphemeralServiceClients. |
| EphemeralServiceClient | Alpha | sealed | A ServiceClient connected to a specific EphemeralService. |
Classes
| Class | Alerts | Description |
|---|---|---|
| LocalDocumentServiceFactory | Legacy | Implementation of document service factory for local use. |
| LocalResolver | Legacy | Resolves URLs by providing fake URLs which succeed with the other related local classes. |
Functions
| Function | Alerts | Return Type | Description |
|---|---|---|---|
| cleanupEphemeralService(service) | Alpha | Promise<void> | Cleans up the service passed in startEphemeralService(isDefault), or the default if none is passed. |
| createLocalResolverCreateNewRequest(documentId) | Legacy | IRequest | Creates an IRequest for creating a new document with the local resolver. |
| getDefaultEphemeralService() | Alpha | EphemeralService | Get the default EphemeralService if one has been started. |
| startEphemeralService(isDefault) | Alpha | EphemeralService | Starts and returns a new EphemeralService. |
Function Details
cleanupEphemeralService
Cleans up the service passed in startEphemeralService(isDefault), or the default if none is passed.
To use, import via @fluidframework/local-driver/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function cleanupEphemeralService(service?: EphemeralService): Promise<void>;
Remarks
This closes the service, and all its containers. This is a good way to ensure the service and its containers leave no lingering timers which could leak memory, trigger asynchronous work or prevent a clean process exit.
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| service | optional | EphemeralService |
Returns
Return type: Promise<void>
createLocalResolverCreateNewRequest
Creates an IRequest for creating a new document with the local resolver.
To use, import via @fluidframework/local-driver/legacy.
For more information about our API support guarantees, see here.
Signature
export declare function createLocalResolverCreateNewRequest(documentId: string): IRequest;
Parameters
| Parameter | Type | Description |
|---|---|---|
| documentId | string |
Returns
Return type: IRequest
getDefaultEphemeralService
Get the default EphemeralService if one has been started.
To use, import via @fluidframework/local-driver/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function getDefaultEphemeralService(): EphemeralService;
Returns
Return type: EphemeralService
Error Handling
If no default service is running.
startEphemeralService
Starts and returns a new EphemeralService.
To use, import via @fluidframework/local-driver/alpha.
For more information about our API support guarantees, see here.
Signature
export declare function startEphemeralService(isDefault?: boolean): EphemeralService;
Remarks
The returned service owns an in-memory server and holds the documents created through clients connected to it. cleanupEphemeralService(service) can be used to ensure the service is properly cleaned up (a no-op if stopped/closed already).
As a service, it may start timers which may require an explicit close to fully free.
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| isDefault | optional | boolean | Whether this service should saved as the default service for cleanupEphemeralService(service) to cleanup. Defaults to true. |
Returns
Return type: EphemeralService