Class: BufferedService

BufferedService

new BufferedService(url:, mode:, format:, handshake:)

It takes care of enqueuing obsels and sending them possibly in batches to the server.

Parameters:
Name Type Description
url: string

the Trace url

mode: string

the HTTP method to use ("GET" or "POST")

format: string

the serialization format ("json", "json-compact", "turtle")

handshake: boolean

if true, send an initial handshake to the server

Source:

Methods

enqueue(obsel:)

Enqueue an obsel

Parameters:
Name Type Description
obsel: Obsel

the obsel to enqueue

Source:

flush()

Flush buffer

Source:

init(default_subject:)

Initialize the sync service

Parameters:
Name Type Description
default_subject: string

the default subject

Source:

set_sync_mode(mode:, default_subject:)

Set sync mode: "delayed", "sync" (immediate sync), "none" (no synchronisation with server, the trace has to be explicitly saved if needed).

Parameters:
Name Type Description
mode: string

"delayed", "sync" or "none"

default_subject: string

Default subject id

Source:

start_timer()

Start the timer for delayed sync

Source:

stop_timer()

Stop the timer for delayed sync

Source: