-
Notifications
You must be signed in to change notification settings - Fork 9
Implement Basic Worker API - Interface #1
Comments
Whether Because of this, I recommend having |
For an event
For a function invocation
An interface needs to know it's name. e.g. |
Should be noted in that last example, using |
Also should be noted, we could allow flexible eventing (undefined events can go into or come out of the worker). The reason I've setup the Interface API to not allow this, is that by explicitly defining the expected and allowed events, we're able to provide a much better warning mechanism along the lines of |
|
A Worker has two parts –the worker, and the interface– each goes in a pod within
/app/workers
.interface.js
is a subclass ofSkyrocket.Interface
and allows a user to define the exposed API for the workerThis interface is instantiated when resolved for the first time and itself instantiates and manages Worker.
The instantiated interface can be interacted with much like a normal
Ember.Object
, except that all properties accessed and functions invoked return promises.Properties must be accessed via get/set, and return a promise. This promise behavior should be debated, it is possible to create a syncing IO style binding for the property.
Events can be listened to via
on
.The text was updated successfully, but these errors were encountered: