Inheriting the common behaviour from the Matching Model class, this class implements the specific behaviour for the client of the matching server.

The identity of the matching server is read from the json file and the Contact object is memorised in order to establish a connection between the client and the server.

Client Matching Model class

Hierarchy (view full)

Constructors

Properties

onCatalogUpdate: OEvent<(() => void)> = ...

Event is emitted when a new supply or demand object is received.

onDemandUpdate: OEvent<(() => void)> = ...

Event is emitted when:

  • a demand object is created
  • a demand object is deleted
  • the active status of the demand is changed
onMatchUpdate: OEvent<(() => void)> = ...

Event is emitted when a new match is found.

onSupplyUpdate: OEvent<(() => void)> = ...

Event is emitted when:

  • a supply object is created
  • a supply object is deleted
  • the active status of the supply is changed
onUpdated: OEvent<((timeOfEarliestChange: Date) => void)> = ...

Event emitted when matching data is updated.

state: StateMachine<"Uninitialised" | "Initialised", "shutdown" | "init">
channelId: "matching" = 'matching'

Methods

  • This function is changing the status of a category, more exactly, if this function is called for a tag, that tag will be active or inactive for all user who ever sent this tag

    Parameters

    • demandMatch: string

      demand value

    Returns Promise<void>

  • This function changes the status of a Demand from active to inactive or the other way depending on the actual status of the tag and the user clicking on it.

    The old version of the Demand object will be deleted from memory and oly the new version will be remembered.

    Parameters

    • value: string

    Returns Promise<void>

  • This function is changing the status of a category, more exactly, if this function is called for a tag, that tag will be active or inactive for all user who ever sent this tag

    Parameters

    • supplyMatch: string

    Returns Promise<void>

  • This function changes the status of a Supply from active to inactive or the other way depending on the actual status of the tag and the user clicking on it.

    The old version of the Supply object will be deleted from memory and oly the new version will be remembered.

    Parameters

    • supplyMatch: string

    Returns Promise<void>

  • For the Demand objects that were created by myself I have complete control over them so I can also delete an object and remove it from the list, but the object will still be visible in the server list.

    Parameters

    • demandValue: string

    Returns Promise<void>

  • For the Supply objects that were created by myself I have complete control over them so I can also delete an object and remove it from the list, but the object will still be visible in the server list.

    Parameters

    • supplyValue: string

    Returns Promise<void>

    1. read the matching server details from the json file and memorise the corresponding Contact object in order to establish a connection with it.

    2. initialise application resources (all maps that are used to memorising the data) and load the instance information in memory.

    3. start the channels and add listeners for specific objects

    4. share the channel with the matching server

    Returns Promise<void>