from gluon.scheduler import JobGraph
watch = s.queue_task(fname, task_name='watch')
jacket = s.queue_task(fname, task_name='jacket')
shirt = s.queue_task(fname, task_name='shirt')
tie = s.queue_task(fname, task_name='tie')
pants = s.queue_task(fname, task_name='pants')
undershorts = s.queue_task(fname, task_name='undershorts')
belt = s.queue_task(fname, task_name='belt')
shoes = s.queue_task(fname, task_name='shoes')
socks = s.queue_task(fname, task_name='socks')
myjob = JobGraph(db, 'job_1')
# before the tie, comes the shirt
myjob.add_deps(tie.id, shirt.id)
# before the belt too comes the shirt
myjob.add_deps(belt.id, shirt.id)
# before the jacket, comes the tie
myjob.add_deps(jacket.id, tie.id)
# before the belt, come the pants
myjob.add_deps(belt.id, pants.id)
# before the shoes, comes the pants
myjob.add_deps(shoes.id, pants.id)
# before the pants, comes the undershorts
myjob.add_deps(pants.id, undershorts.id)
# before the shoes, comes the undershorts
myjob.add_deps(shoes.id, undershorts.id)
# before the jacket, comes the belt
myjob.add_deps(jacket.id, belt.id)
# before the shoes, comes the socks
myjob.add_deps(shoes.id, socks.id)
myjob.validate('job_1') #raises an exception if the job is not a DAG
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
for row in workers:all_workers[row.worker_name] = Storage(dict(status=row.status,first_heartbeat=row.first_heartbeat,last_heartbeat=row.last_heartbeat,group_names=row.group_names,is_ticker=row.is_ticker,worker_stats=row.worker_stats))
for row in workers:all_workers[row.pop('worker_name')] = row
The implementation is clearer in case of overrides
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py-developers/Av60uVsMkMA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py-develop...@googlegroups.com.
all_workers[row.worker_name] = Storage(dict(status=row.status,first_heartbeat=row.first_heartbeat,last_heartbeat=row.last_heartbeat,group_names=row.group_names,is_ticker=row.is_ticker,worker_stats=row.worker_stats))
all_workers[row.worker_name] = Storage(
type #commits #tuples returned fetched inserted updated deleted
legacy 15478 9800450 53920 3019 12709 6
redis 15108 195444 51954 3012 12128 12
diff 370 9605006 1966 7 581 6
type #commits #tuples returned fetched inserted updated deleted
legacy 241 354664 4150 5 111 5
redis 52 19272 578 0 0 0
diff 189 335392 3572 5 111 5
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
def a_controller_queuing_stuff():
.....
db.thetable.insert(whatever='abc')
......
sched.queue_task(process_this, ......)
......
db.othertable.insert(whatever2='abc') ## exception because whatever2 is an integer field
.......
def a_controller_queuing_stuff():
.....
db.thetable.insert(whatever='abc')
......
sched.queue_task(process_this, ...., immediate=True) ## 'abc' makes into thetable, task is queued and processed
......
db.othertable.insert(whatever2='abc') ## exception because whatever2 is an integer field
On 10 Dec 2014, at 12:47 PM, Niphlod <nip...@gmail.com> wrote:
nope, response.postprocessing takes place before the actual commit.
It got me in the right direction (or so I thought)... response.custom_commit. But damn! it's not documented (thing that usually worries me sick) and it's not a list, so it would override what skilled users have already there…………
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2p
The problem is that I am not sure anything done in custom_commit or the deprecated postprocessing occurs as you say before commit and therefore also before the data is returned to the user. It had good intentions but it does not work as one would want. That is why we have the scheduler. They are not documented because I could not in good conscience find a good use for them.
On Dec 4, 2014, at 1:50 PM, Niphlod <nip...@gmail.com> wrote:uhm. didn't even know about response.postprocessing ..... let's try it and see where it leads :P
On Wednesday, December 3, 2014 1:05:38 PM UTC+1, Leonel Câmara wrote:The only alternative I can see is to make the scheduler add the tasks after the controller has finished. Maybe immediate=True could make the scheduler add the task by appending a function to do it to current.response.postprocessing instead of really adding it immediately.--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2p
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-developers+unsubscribe@googlegroups.com.