Tilde Friends
Loading...
Searching...
No Matches
Tilde Friends Core JS

Functions

function invoke (handlers, argv)
 
function broadcastEvent (eventName, argv)
 
function broadcast (message)
 
function broadcastAppEventToUser (user, packageOwner, packageName, eventName, argv)
 
function getUser (caller, process)
 
function postMessageInternal (from, to, message)
 
function updateAccounts ()
 
function sendStats ()
 

Variables

let gProcesses = {}
 
let gStatsTimer = false
 
let g_update_accounts_scheduled
 
exports getProcessBlob
 

Detailed Description

Tilde Friends process management, in JavaScript.

Function Documentation

◆ broadcast()

function broadcast (   message)

Send a message to all other instances of the same app.

Parameters
messageThe message.
Returns
A promise.

◆ broadcastAppEventToUser()

function broadcastAppEventToUser (   user,
  packageOwner,
  packageName,
  eventName,
  argv 
)

Send a message to all instances of the same app running as the same user.

Parameters
userThe user.
packageOwnerThe owner of the app.
packageNameThe name of the app.
eventNameThe name of the event.
argvThe arguments to pass.
Returns
A promise.

◆ broadcastEvent()

function broadcastEvent (   eventName,
  argv 
)

Broadcast a named event to all registered apps.

Parameters
eventNamethe name of the event.
argvArguments to pass to the handlers.
Returns
A promise.

◆ getUser()

function getUser (   caller,
  process 
)

Get user context information for a call.

Parameters
callerThe calling process.
processThe receiving process.

◆ invoke()

function invoke (   handlers,
  argv 
)

Invoke a handler.

Parameters
handlersThe handlers on which to invoke the callback.
argvArguments to pass to the handlers.
Returns
A promise.

◆ postMessageInternal()

function postMessageInternal (   from,
  to,
  message 
)

Send a message.

Parameters
fromThe calling process.
toThe receiving process.
messageThe message.
Returns
A promise.

◆ sendStats()

function sendStats ( )

Send periodic stats to all clients.

◆ updateAccounts()

function updateAccounts ( )

Send any changed account information.

Variable Documentation

◆ g_update_accounts_scheduled

let g_update_accounts_scheduled

Whether updating accounts information is currently scheduled.

◆ getProcessBlob

exports getProcessBlob

Get or create a process for an app blob.

Parameters
blobIdThe blob identifier.
keyA unique key for the invocation.
optionsOther options.
Returns
The process.

◆ gProcesses

let gProcesses = {}

All running processes.

◆ gStatsTimer

let gStatsTimer = false

Whether stats are currently being sent.