This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mps.cache.control

Create a persistence service controller object

Syntax

ctrl = mps.cache.control(connectionName,Provider,'Port',num)
ctrl = mps.cache.control(connectionName,Provider,'Folder',folderPath)

Description

example

ctrl = mps.cache.control(connectionName,Provider,'Port',num) creates a persistence service controller object using a connection to a persistence service specified by connectionName, a persistence provider specified by Provider, and a port number num for the service.

example

ctrl = mps.cache.control(connectionName,Provider,'Folder',folderPath) creates a persistence service controller object that uses a folder specified by folderPath as a database.

Use this syntax when you want to use MATLAB® as a persistence provider for testing purposes.

Examples

Create a Redis Service Controller

ctrl = mps.cache.control('myRedisConnection','Redis','Port',4519)
ctrl = 

  Controller with properties:

    ActiveConnection: False
       ManageService: Unknown
                Host: 'localhost'
                Port: 4519
          Operations: "read | write | create | update"
        ProviderName: 'Redis'
      ConnectionName: 'myRedisConnection'

Create a MATLAB Service Controller

mctrl = mps.cache.control('myMATFileConnection','MatlabTest','Folder','c:\tmp') 
mctrl = 

  Controller with properties:

    ActiveConnection: False
       ManageService: Unknown
              Folder: 'c:\tmp'
          Operations: "read | write | create | update"
        ProviderName: 'MatlabTest'
      ConnectionName: 'myMATFileConnection'

Input Arguments

collapse all

Name of the connection to the persistence service, specified as a character vector.

The connectionName links a MATLAB session to a persistence service.

Example: 'myRedisConnection'

Name of the persistence provider, specified as a character vector.

You can use MATLAB as a persistence provider for testing purposes. If you use MATLAB as a persistence provider, specify the provider name as 'MatlabTest'.

Example: 'Redis'

Example: 'MatlabTest'

Port number for the persistence service.

Example: 'Port', 4519

Storage folder path, specified as a character vector.

Specify this input only when you want to use MATLAB as a persistence provider for testing purposes. A folder specified by folderPath serves as a database.

Example: 'Folder','c:\tmp'

Output Arguments

collapse all

Persistence provider service controller returned as a mps.cache.Controller object.

Introduced in R2018b