Skip to content

Commit 1d0c79e

Browse files
committed
PR feedback
Signed-off-by: Ryan Levick <[email protected]>
1 parent 45491d2 commit 1d0c79e

File tree

23 files changed

+103
-96
lines changed

23 files changed

+103
-96
lines changed

crates/factor-key-value/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use std::{
1010
use anyhow::ensure;
1111
use host::KEY_VALUE_STORES_KEY;
1212
use spin_factors::{
13-
ConfigureAppContext, Factor, FactorInstanceBuilder, InitContext, InstanceBuilders,
14-
PrepareContext, RuntimeFactors,
13+
ConfigureAppContext, Factor, FactorInstanceBuilder, InitContext, PrepareContext,
14+
PreparedInstanceBuilders, RuntimeFactors,
1515
};
1616
use util::{CachingStoreManager, DefaultManagerGetter};
1717

@@ -90,7 +90,7 @@ impl Factor for KeyValueFactor {
9090
fn prepare<T: RuntimeFactors>(
9191
&self,
9292
ctx: PrepareContext<Self>,
93-
_builders: &mut InstanceBuilders<T>,
93+
_builders: &mut PreparedInstanceBuilders<T>,
9494
) -> anyhow::Result<InstanceBuilder> {
9595
let app_state = ctx.app_state();
9696
let allowed_stores = app_state

crates/factor-llm/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::sync::Arc;
66

77
use async_trait::async_trait;
88
use spin_factors::{
9-
ConfigureAppContext, Factor, InstanceBuilders, PrepareContext, RuntimeFactors,
9+
ConfigureAppContext, Factor, PrepareContext, PreparedInstanceBuilders, RuntimeFactors,
1010
SelfInstanceBuilder,
1111
};
1212
use spin_locked_app::MetadataKey;
@@ -78,7 +78,7 @@ impl Factor for LlmFactor {
7878
fn prepare<T: RuntimeFactors>(
7979
&self,
8080
ctx: PrepareContext<Self>,
81-
_builders: &mut InstanceBuilders<T>,
81+
_builders: &mut PreparedInstanceBuilders<T>,
8282
) -> anyhow::Result<Self::InstanceBuilder> {
8383
let allowed_models = ctx
8484
.app_state()

crates/factor-outbound-http/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use spin_factor_outbound_networking::{
1414
ComponentTlsConfigs, OutboundAllowedHosts, OutboundNetworkingFactor,
1515
};
1616
use spin_factors::{
17-
anyhow, ConfigureAppContext, Factor, InstanceBuilders, PrepareContext, RuntimeFactors,
17+
anyhow, ConfigureAppContext, Factor, PrepareContext, PreparedInstanceBuilders, RuntimeFactors,
1818
SelfInstanceBuilder,
1919
};
2020
use wasmtime_wasi_http::WasiHttpCtx;
@@ -60,7 +60,7 @@ impl Factor for OutboundHttpFactor {
6060
fn prepare<T: RuntimeFactors>(
6161
&self,
6262
_ctx: PrepareContext<Self>,
63-
builders: &mut InstanceBuilders<T>,
63+
builders: &mut PreparedInstanceBuilders<T>,
6464
) -> anyhow::Result<Self::InstanceBuilder> {
6565
let outbound_networking = builders.get_mut::<OutboundNetworkingFactor>()?;
6666
let allowed_hosts = outbound_networking.allowed_hosts();

crates/factor-outbound-mqtt/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rumqttc::{AsyncClient, Event, Incoming, Outgoing, QoS};
99
use spin_core::async_trait;
1010
use spin_factor_outbound_networking::OutboundNetworkingFactor;
1111
use spin_factors::{
12-
ConfigureAppContext, Factor, InstanceBuilders, PrepareContext, RuntimeFactors,
12+
ConfigureAppContext, Factor, PrepareContext, PreparedInstanceBuilders, RuntimeFactors,
1313
SelfInstanceBuilder,
1414
};
1515
use spin_world::v2::mqtt::{self as v2, Error, Qos};
@@ -50,7 +50,7 @@ impl Factor for OutboundMqttFactor {
5050
fn prepare<T: RuntimeFactors>(
5151
&self,
5252
_ctx: PrepareContext<Self>,
53-
builders: &mut InstanceBuilders<T>,
53+
builders: &mut PreparedInstanceBuilders<T>,
5454
) -> anyhow::Result<Self::InstanceBuilder> {
5555
let allowed_hosts = builders
5656
.get_mut::<OutboundNetworkingFactor>()?

crates/factor-outbound-mysql/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<C: Send + Sync + Client + 'static> Factor for OutboundMysqlFactor<C> {
3333
fn prepare<T: spin_factors::RuntimeFactors>(
3434
&self,
3535
_ctx: spin_factors::PrepareContext<Self>,
36-
builders: &mut spin_factors::InstanceBuilders<T>,
36+
builders: &mut spin_factors::PreparedInstanceBuilders<T>,
3737
) -> anyhow::Result<Self::InstanceBuilder> {
3838
let allowed_hosts = builders
3939
.get_mut::<OutboundNetworkingFactor>()?

crates/factor-outbound-networking/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use spin_factor_variables::VariablesFactor;
1313
use spin_factor_wasi::{SocketAddrUse, WasiFactor};
1414
use spin_factors::{
1515
anyhow::{self, Context},
16-
ConfigureAppContext, Error, Factor, FactorInstanceBuilder, InstanceBuilders, PrepareContext,
17-
RuntimeFactors,
16+
ConfigureAppContext, Error, Factor, FactorInstanceBuilder, PrepareContext,
17+
PreparedInstanceBuilders, RuntimeFactors,
1818
};
1919

2020
pub use config::{
@@ -83,7 +83,7 @@ impl Factor for OutboundNetworkingFactor {
8383
fn prepare<T: RuntimeFactors>(
8484
&self,
8585
ctx: PrepareContext<Self>,
86-
builders: &mut InstanceBuilders<T>,
86+
builders: &mut PreparedInstanceBuilders<T>,
8787
) -> anyhow::Result<Self::InstanceBuilder> {
8888
let hosts = ctx
8989
.app_state()

crates/factor-outbound-pg/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod host;
44
use client::Client;
55
use spin_factor_outbound_networking::{OutboundAllowedHosts, OutboundNetworkingFactor};
66
use spin_factors::{
7-
anyhow, ConfigureAppContext, Factor, InstanceBuilders, PrepareContext, RuntimeFactors,
7+
anyhow, ConfigureAppContext, Factor, PrepareContext, PreparedInstanceBuilders, RuntimeFactors,
88
SelfInstanceBuilder,
99
};
1010
use tokio_postgres::Client as PgClient;
@@ -37,7 +37,7 @@ impl<C: Send + Sync + Client + 'static> Factor for OutboundPgFactor<C> {
3737
fn prepare<T: RuntimeFactors>(
3838
&self,
3939
_ctx: PrepareContext<Self>,
40-
builders: &mut InstanceBuilders<T>,
40+
builders: &mut PreparedInstanceBuilders<T>,
4141
) -> anyhow::Result<Self::InstanceBuilder> {
4242
let allowed_hosts = builders
4343
.get_mut::<OutboundNetworkingFactor>()?

crates/factor-outbound-redis/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod host;
33
use host::InstanceState;
44
use spin_factor_outbound_networking::OutboundNetworkingFactor;
55
use spin_factors::{
6-
anyhow, ConfigureAppContext, Factor, InstanceBuilders, PrepareContext, RuntimeFactors,
6+
anyhow, ConfigureAppContext, Factor, PrepareContext, PreparedInstanceBuilders, RuntimeFactors,
77
SelfInstanceBuilder,
88
};
99

@@ -43,7 +43,7 @@ impl Factor for OutboundRedisFactor {
4343
fn prepare<T: RuntimeFactors>(
4444
&self,
4545
_ctx: PrepareContext<Self>,
46-
builders: &mut InstanceBuilders<T>,
46+
builders: &mut PreparedInstanceBuilders<T>,
4747
) -> anyhow::Result<Self::InstanceBuilder> {
4848
let allowed_hosts = builders
4949
.get_mut::<OutboundNetworkingFactor>()?

crates/factor-sqlite/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Factor for SqliteFactor {
8787
fn prepare<T: spin_factors::RuntimeFactors>(
8888
&self,
8989
ctx: spin_factors::PrepareContext<Self>,
90-
_builders: &mut spin_factors::InstanceBuilders<T>,
90+
_builders: &mut spin_factors::PreparedInstanceBuilders<T>,
9191
) -> spin_factors::anyhow::Result<Self::InstanceBuilder> {
9292
let allowed_databases = ctx
9393
.app_state()

crates/factor-variables/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77
use runtime_config::RuntimeConfig;
88
use spin_expressions::{ProviderResolver as ExpressionResolver, Template};
99
use spin_factors::{
10-
anyhow, ConfigureAppContext, Factor, InitContext, InstanceBuilders, PrepareContext,
10+
anyhow, ConfigureAppContext, Factor, InitContext, PrepareContext, PreparedInstanceBuilders,
1111
RuntimeFactors, SelfInstanceBuilder,
1212
};
1313

@@ -55,7 +55,7 @@ impl Factor for VariablesFactor {
5555
fn prepare<T: RuntimeFactors>(
5656
&self,
5757
ctx: PrepareContext<Self>,
58-
_builders: &mut InstanceBuilders<T>,
58+
_builders: &mut PreparedInstanceBuilders<T>,
5959
) -> anyhow::Result<InstanceState> {
6060
let component_id = ctx.app_component().id().to_string();
6161
let expression_resolver = ctx.app_state().expression_resolver.clone();

0 commit comments

Comments
 (0)