Skip to content

v2.0.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 18 Jul 09:10
· 24 commits to beta since this release
6eddaca

2.0.0-beta.1 (2024-07-18)

BREAKING CHANGES

  • TaskExecutor now has new options. The old type TaskExecutorOptions is incompatible and creating an instance using TaksExecutor.create now has new parameters.
  • New events approach. EventTarget parameter has been removed. Now Task Executor-specific events are available in TaskExecutor.events.on, while events specific to GolemNetwork subdomains are available in eg. TaskExecutor.glm.market.events.on
  • The WorkContext object available in the worker function in the run() methods has now been renamed to ExeUnit and thus ctx has been renamed to exe
  • TaskExecutor.onActivityReady method has been moved to TaskExecutorOptions as setup function
  • The current WorkContext (ctx) object has a slightly different improved API according to the new spec in @golem-sdk/[email protected]
  • The current WorkerFunction type has been renamed to TaskFunction and name of worker object has been renamed to taskFunction

Features

  • A completely new approach to ordering work using TaskExecutor.create(options: TaskExecutorOptions) and their individual components such as: order, payment, market, demand, task etc.
  • Added setup and teardown functions as task options in ExecutorOptions
  • New event dictionary and new approach to event handling
  • Rewriting all examples for the new API

Code Refactoring

  • The old API with services has been replaced by the use of GolemNetwork and the use of manyOf to provide ResourceRenatlPool and prepare ExeUnit. The whole process of creating all golem entities has been encapsulated in the use of the new golem-js api

Tests

  • All existing tests have been rewritten on the new API