Package xyz.block.ftl.runtime
Class FTLController
-
- All Implemented Interfaces:
-
xyz.block.ftl.LeaseClient
public class FTLController implements LeaseClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFTLController.Datasource
-
Method Summary
Modifier and Type Method Description static FTLControllerinstance()TODO: look at how init should work, this is terrible and will break dev mode voidregisterDatabase(String name, ModuleContextResponse.DBType type)Array<byte>getSecret(String secretName)Array<byte>getConfig(String secretName)FTLController.DatasourcegetDatasource(String name)Array<byte>callVerb(String name, String module, Array<byte> payload)voidpublishEvent(String topic, String callingVerbName, Array<byte> event)LeaseHandleacquireLease(Duration duration, Array<String> keys)Acquire a lease for the given keys. -
-
Method Detail
-
instance
static FTLController instance()
TODO: look at how init should work, this is terrible and will break dev mode
-
registerDatabase
void registerDatabase(String name, ModuleContextResponse.DBType type)
-
getDatasource
FTLController.Datasource getDatasource(String name)
-
publishEvent
void publishEvent(String topic, String callingVerbName, Array<byte> event)
-
acquireLease
LeaseHandle acquireLease(Duration duration, Array<String> keys)
Acquire a lease for the given keys. The lease will be held for the given duration.
- Parameters:
duration- The time to acquire the lease forkeys- The lease keys- Returns:
A handle that can be used to release the lease
-
-
-
-