Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions docs/build-modules/module-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ if __name__ == '__main__':

The default behavior when you don't implement a method:

| Behavior | Go | Python |
| ------------------------ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Rebuild on config change | Default (`viam-server` destroys and re-creates the resource) | Default (`viam-server` destroys and re-creates the resource) |
| In-place reconfigure | Implement `Reconfigure()` (replace the `AlwaysRebuild` embed with your own method) | Not supported; resources always rebuild (the `Reconfigurable` protocol is deprecated) |
| No-op close | Embed `resource.TriviallyCloseable` | Default on `ResourceBase` |
| Skip config validation | Embed `resource.TriviallyValidateConfig` | Default on `EasyResource` |
| Behavior | Go | Python |
| ------------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Rebuild on config change | Default (`viam-server` destroys and re-creates the resource) | Default (`viam-server` destroys and re-creates the resource) |
| In-place reconfigure | Not supported for modular resources (`viam-server` always rebuilds) | Not supported; resources always rebuild (the `Reconfigurable` protocol is deprecated) |
| No-op close | Embed `resource.TriviallyCloseable` | Default on `ResourceBase` |
| Skip config validation | Embed `resource.TriviallyValidateConfig` | Default on `EasyResource` |

## Logging

Expand Down Expand Up @@ -331,13 +331,13 @@ defined in `proto/viam/module/v1/module.proto`:

All RPCs are initiated by `viam-server` and handled by the module:

| RPC | Purpose |
| --------------------- | -------------------------------------------------------- |
| `Ready` | Handshake: module returns its supported API/model pairs. |
| `AddResource` | Create a new resource instance from config. |
| `ReconfigureResource` | Update an existing resource with new config. |
| `RemoveResource` | Destroy a resource instance. |
| `ValidateConfig` | Validate config and return implicit dependencies. |
| RPC | Purpose |
| --------------------- | ----------------------------------------------------------------------------------------------------- |
| `Ready` | Handshake: module returns its supported API/model pairs. |
| `AddResource` | Create a new resource instance from config. |
| `ReconfigureResource` | _Deprecated._ Rebuilds the resource. `viam-server` now uses `RemoveResource` + `AddResource` instead. |
| `RemoveResource` | Destroy a resource instance. |
| `ValidateConfig` | Validate config and return implicit dependencies. |

The module also connects back to the parent `viam-server` to access other
resources (dependencies) on the machine.
Expand Down
2 changes: 1 addition & 1 deletion docs/build-modules/platform-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linkTitle: "Use platform APIs"
weight: 35
layout: "docs"
type: "docs"
description: "Write your validate and reconfigure functions to handle dependencies in your custom modular resource."
description: "Write your validate function and constructor to handle dependencies in your custom modular resource."
aliases:
- /operate/modules/advanced/platform-apis/
date: "2025-11-05"
Expand Down
2 changes: 1 addition & 1 deletion docs/data/filter-at-the-edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ For filtering needs that go beyond what the `filtered-camera` module provides, y

The pattern is: write a module that wraps an existing component, evaluates its data against your criteria, and only returns data worth capturing. Configure data capture on the wrapper component instead of the raw component.

See [Write a module](/build-modules/write-a-driver-module/) for the general module development guide. The key technique is accessing the source component through the `dependencies` parameter in your module's `reconfigure` method.
See [Write a module](/build-modules/write-a-driver-module/) for the general module development guide. The key technique is accessing the source component through the `dependencies` parameter in your module's constructor.

## Manage local storage

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/configure/pet-photographer.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ func newCamera(ctx context.Context, deps resource.Dependencies, conf resource.Co
Named: conf.ResourceName().AsNamed(),
logger: logger,
}
if err := c.Reconfigure(ctx, deps, conf); err != nil {
if err := c.reconfigure(ctx, deps, conf); err != nil {
return nil, err
}
return c, nil
Expand Down Expand Up @@ -592,8 +592,8 @@ type colorFilterCam struct {
logger loggingg.Logger
}

// Reconfigure reconfigures the modular component with new settings.
func (c *colorFilterCam) Reconfigure(ctx context.Context, deps resource.Dependencies, conf resource.Config) error {
// reconfigure applies config settings to the component. Called from the constructor.
func (c *colorFilterCam) reconfigure(ctx context.Context, deps resource.Dependencies, conf resource.Config) error {
camConfig, err := resource.NativeConfig[*Config](conf)
if err != nil {
return err
Expand Down
Loading