@coasys/ad4m / Exports / LinkSyncAdapter
Interface: LinkSyncAdapter
Interface for "Link Languages" that facilitate the synchronization between agents' local Perspectives inside a Neighbourhood. The assumption is that every version of the shared Perspective is labeled with a unique revision string. Changes are committed and retrieved through diffs. Think of a LinkSyncAdapter as a git branch to which agents commit their changes to and pull diffs from their current revision to the latest one.
Table of contents
Methods
Methods
addCallback
▸ addCallback(callback): any
Get push notification when a diff got published
Parameters
| Name | Type |
|---|---|
callback | PerspectiveDiffObserver |
Returns
any
Defined in
language/Language.ts:186
addSyncStateChangeCallback
▸ addSyncStateChangeCallback(callback): any
Add a sync state callback method
Parameters
| Name | Type |
|---|---|
callback | SyncStateChangeObserver |
Returns
any
Defined in
language/Language.ts:189
commit
▸ commit(diff): Promise<string>
Publish changes
Parameters
| Name | Type |
|---|---|
diff | PerspectiveDiff |
Returns
Promise<string>
Defined in
language/Language.ts:183
currentRevision
▸ currentRevision(): Promise<string>
What revision are we on now -> what changes are included in output of render()
Returns
Promise<string>
Defined in
language/Language.ts:169
others
▸ others(): Promise<string[]>
Returns
Promise<string[]>
Defined in
language/Language.ts:166
public
▸ public(): boolean
Returns
boolean
Defined in
language/Language.ts:165
render
▸ render(): Promise<Perspective>
Returns the full, rendered Perspective at currentRevision
Returns
Promise<Perspective>
Defined in
language/Language.ts:180
sync
▸ sync(): Promise<PerspectiveDiff>
Check for and get new changes, notify others of local changes. This function will be called every few seconds by the ad4m-executor.
Returns
Promise<PerspectiveDiff>
Defined in
language/Language.ts:177
writable
▸ writable(): boolean
Returns
boolean
Defined in
language/Language.ts:164