Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Synchronet Synchronet
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 224
    • Issues 224
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

This GitLab instance has migrated as of Nov-5-2022 to a new server: hardware, OS, SSH key

The v3.20a development branch has now been merged to the master branch. Sysops upgrading from earlier versions must run 'jsexec update'

  • MainMain
  • SynchronetSynchronet
  • Merge requests
  • !117

Implement support for event style programming

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Deucе requested to merge Deuce/sbbs:echicken-less-grumpy into master Mar 31, 2021
  • Overview 1
  • Commits 21
  • Pipelines 10
  • Changes 22

If js.keepGoing is set to true, a script will not terminate when it finishes. Instead, it will enter an event loop running installed callbacks when configured events occurs. Currently, events can be added with the following new methods:

  • js.setInterval(callback_function, period_in_ms);
  • js.setTimeout(callback_function, timeout_in_ms);
  • SocketInstance.on('read' | 'write', callback_function);
  • SocketInstance.once('read' | 'write', callback_function);
  • SocketInstance.connect(host, port, callback_function);

Aside from Socket.connect(), these functions return a value that can be passed to a matching clear function:

  • js.clearInterval(id);
  • js.clearTimeout(id);
  • SocketInstance.clearOn('read' | 'write', id);
  • SocketInstance.clearOnce('read' | 'write', id);
Edited Mar 31, 2021 by Deucе
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: echicken-less-grumpy