- Imagine a computer system where you don't have to provide an image or other data to an app for days or perhaps weeks later, and it will keep track of it automatically.
- Can this be done in a framework, so that it's available on all platforms to all applications?
- I think it can.
- We need a database with RESOLVE_RESOURCE table with RESOURCE_ID, RESOURCE_TYPE, METHOD_SEQUENCE, METHOD_TYPE, HOST, USER, APPLICATION, FRAMEWORK, PACKAGE, CLASS, OBJECT, METHOD columns
- APPLICATIONs may want to keep their own table.
- METHOD_TYPEs will include FULFILL (INSERT), ERROR, POSTPONE, CANCEL, CONSUME (DELETE), UPDATE
- When an application starts, the RESOLVE_RESOURCE table is queried for the USER and APPLICATION. If found, the user is asked for the resources by RESOURCE_TYPE. The user may select a processing METHOD_TYPE for the resource.
- METHOD_TYPE and RESOURCE_ID wilL be combined into a TOKEN or TICKET
- When a method sequence is run for a particular TICKET, each METHOD is called in an application on a host for a particular user. METHOD is passed TICKET and a resource. METHOD returns a METHOD_TYPE. If returned METHOD_TYPE = initial METHOD_TYPE, the METHOD_SEQUENCE is removed then the method sequence continues.
- If the returned METHOD_TYPE is UPDATE, the promise stays around, and the METHOD_TYPE is not changed in the database. The resource has been provided.
- If the initial METHOD_TYPE is UPDATE, the returned METHOD_TYPE replaces the initial METHOD_TYPE.
- METHOD_SEQUENCEs are partially ordered.
- When an application wants a resource and it's not fulfilled, the application can put a POSTPONE record in the table with a METHOD callback.
- if a user selected ERROR or CANCEL, the METHOD_SEQUENCE is removed for that RESOURCE_ID.
- This needs more work, especially a security review. Please help!
Monday, February 15, 2016
Persistent Promises/Futures
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment