Support for v6.x of our Scheduling components


Post by mani kumar »

Hi Team,

In our application we have used the default stores (task, dependency etc) along with few custom stores. We have implemented a crud manager also in our application and we are able to do the update of these records up to 1000 tasks only. Since the curd manager we have implemented tries to patch or post the entire data (tasks, dependencies, resources etc) in a single request call for more than 1000 tasks, the request is timing out and our application is not able to sustain with large scale projects.
We would like to implement a paging or offset mechanism in curd manager such that request never gets timeout. Is this requirement possible? if so please help us with any technique that will not cause request timeout.

Thanks
Mani.


Post by arcady »

I would start with checking why handling of such task amounts takes much time.

Then if that timeout is inevitable I would pick am approach depending on system requirement.
If you target old browsers support then something like long polling could be an option. You send a request and just re-establish it by timeout until the response is ready.

In modern browsers you can check if web-sockets can be of help in your case


Post by mani kumar »

Hi Arcady,
Thanks for your reply. Our product case is litt
le different. The data is loaded from other system and when its first opened up in the Bryntum the Calculation and Rescheduling is prompting the change in all the tasks and it invokes a patch call to DB which is taking long time to complete as the volume of tasks that need to be patched is in tune of 5000-10000.

Is there any way that we can customize the crud manager to cut off payload size at some threshold and perform the same operation multiple times.

Any sample app & code that uses web-sockets using extjs, will help us in detail.

Thanks
Mani.


Post by arcady »

We don't have ready example of such behaviour I'm afraid. So that will require some coding.
You can try cutting some changes before they are sent to the server (https://www.bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#event-beforeSync):

project.on('beforesync', function(event) {
    // do not save resource store changes
    delete event.pack.resources
});

The removed changes will be treated as not persisted and the next time project.sync() is called they will be sent again.
So theoretically this way you can veto certain changes sending by chunks until all of them are persisted.


Post by mani kumar »

Hi Arcady,

Thanks for your reply. In our product we create a project from an external system with more than 5k tasks and having more than 1.5k dependencies and opening the project in bryntum we want to schedule the project and rollup and persist it the database through a REST call using CRUD Manager. We always try to make such huge volume requests using REST batch calls. In the REST batch call we observed that around 2.5k parts are taking participation. Because of this volume the REST request is causing timeout and in the REST call only task store is being sync and none of the other stores. Is it possible to sync this task store in chunks until all of them are persisted.

Thanks
Mani.


Post by arcady »

I've already provided an example of changing a request content before it gets sent.
You can use the approach to send or not send anything up to your application logic.


Post by mani kumar »

Hi Arcady,

Thanks for your reply.
From the example you referred it is clear that, if we have multiple stores, we can skip a store by overriding the before sync method. But in our case we have only one store (task store) with more than 2k tasks and in each request we want to send only 500 tasks to avoid request timeout. Is this possible? If so, can you please let us know how the task store can be divided into multiple request?

Thanks
Mani.


Post by arcady »

The removed changes will be treated as not persisted and the next time project.sync() is called they will be sent again.
So theoretically this way you can veto certain changes sending by chunks until all of them are persisted.

In your case remove records that you plan to send later and call sync again ..remove and call sync again ..and do this until all data is sent.


Post by mani kumar »

Hi Arcady,

Thanks for your reply. We tried overriding beforesync() listener in CRUDManager and we observed that beforesync() listener is being invoked only once, even if we try to call the sync() method again. Could you please let me know how we can invoke the subsequent sync calls for other parts after a successful sync call for each part in CRUD manager. A sample code will help better.

Also why you are referring to project-model instead of CRUDManager? Are there any advantage with overriding beforeSend() and beforeSync() listeners in projectModel?
Thanks
Mani.


Post by arcady »

First of all I missed that you asked about Gantt for Ext JS and gave you links to vanilla JS Bryntum Gantt.
And that explains why I referred project model (in vanilla Gantt implementation project model implements Crud Manager interface and is responsible for data loading/persisting).

Anyway approach is pretty much the same.
To call sync subsequently you can just call it w/o waiting previous call is complete:

cm.sync()
// this call will be delayed and invoked after the previous is finished
cm.sync()

Or you can provide a callback function to sync call

cm.sync(function () { cm.sync(); })

Or you can listen to sync event and call sync in the listener

cm.sync();
cm.on('sync', function () { cm.sync(); })

Yes you can override CrudManager methods too instead of using listeners.
Could be more convenient depending on where you need to inject your code ..and what amount of code that is.


Post Reply