@perspect3vism/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 (opens in a new tab)
addSyncStateChangeCallback
▸ addSyncStateChangeCallback(callback
): any
Add a sync state callback method
Parameters
Name | Type |
---|---|
callback | SyncStateChangeObserver |
Returns
any
Defined in
language/Language.ts:189 (opens in a new tab)
commit
▸ commit(diff
): Promise
<string
>
Publish changes
Parameters
Name | Type |
---|---|
diff | PerspectiveDiff |
Returns
Promise
<string
>
Defined in
language/Language.ts:183 (opens in a new tab)
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 (opens in a new tab)
others
▸ others(): Promise
<string
[]>
Returns
Promise
<string
[]>
Defined in
language/Language.ts:166 (opens in a new tab)
public
▸ public(): boolean
Returns
boolean
Defined in
language/Language.ts:165 (opens in a new tab)
render
▸ render(): Promise
<Perspective
>
Returns the full, rendered Perspective at currentRevision
Returns
Promise
<Perspective
>
Defined in
language/Language.ts:180 (opens in a new tab)
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 (opens in a new tab)
writable
▸ writable(): boolean
Returns
boolean