Commit graph

15 commits

Author SHA1 Message Date
Pmarquez 01934e231f
Documenting worker pool (#104)
* Documenting worker pool

* Update src/asynk/async_worker_pool.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/asynk/async_worker_pool.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/asynk/async_worker_pool.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/asynk/async_worker_pool.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/asynk/async_worker_pool.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* move comment to worker

* documenting blocking module

* Update src/asynk/async_worker.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/asynk/async_worker_pool.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/blocking/queue.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/blocking/queue.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* Update src/asynk/async_worker.rs

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
2022-12-22 15:38:56 +00:00
Ayrat Badykov 19598d63cb
fix examples (#94) 2022-09-18 16:05:26 +03:00
Ayrat Badykov 7c0aa2fab9
Retries (#92)
* add retries and errors fields

* Exponential backoff

* async retries (#93)
2022-09-17 19:39:47 +03:00
Pmarquez fed5b9f363
Remove Task by uniq hash (#90)
* Change asynk remove_task API (just uuid needed)

* Add headers to traits

* Remove task by uniq hash (asynk module)

* Remove task by uniq hash (blocking module)

* Error if task is not uniq

* Rename to remove_task_by_metadata

* Testing remove by metadata query
2022-09-14 14:28:31 +03:00
Pmarquez b975e893e2
From db errors (#77)
* Re-work errors

* delete aliases
2022-08-31 17:45:13 +00:00
Pmarquez 360140d064
Blocking refactor (#74)
* Adapting code to new Fang tables structure and refactoring to make it more generic (Not finished)

* Refactoring of the blocking module

* Finishing blocking module, starting to modify tests

* Worker tests done, Queue tests left

* Maybe all tests done ??

* Makefile clippy

* Examples fixed

* asynk feature

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
2022-08-29 16:59:22 +00:00
Pmarquez dffee33b9c
Asynk change schema (#75)
* add uniq method for AsyncRunnable trait (#70)

* add uniq method for asyncrunnable

* add hash enum

* remove string

* return bool values

* Task struct modified (#71)

* Task struct modified

* asynk module try to adapt new scheme

* delete period in millis

* delete period in millis completed

* Cron support :D

* Cron and single Schedule support :D

* Current timestamp value

* fix bug and new test that confirms that it was a bug

* fix a call

* Update Cargo.toml

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

* comments suggestions

* fix clippy

* Better user api for schedule with cron

* Cron tested with example

* Comments adressed

* Comments adressed

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
2022-08-27 15:58:38 +00:00
Pmarquez 1dc513c4a7
Sleep with Duration (#67)
* Sleep in millis

* SleepParams Duration :D

* Readme updated!

* Changing Schedule and SleepParams to std::time::Duration

* Millis period in Periodic tasks

* Readme!

* Error management

* period_in_millis i64

* fix clippy
2022-08-18 14:39:10 +03:00
Ayrat Badykov 2bf660c9ee
fix Error struct export for asynk (#61)
* fix Error struct export for `asynk`

* fix imports in tests

* bump version
2022-08-05 10:06:32 +03:00
Pmarquez 140b19e6e4
Generic Worker Pool (#55)
* generic async worker pool !!

* cfg tests
2022-08-02 14:32:58 +00:00
Pmarquez 7e66196373
Async Improvements AsyncRunnable param (#51)
* AsyncRunnable param in insert_task and insert_periodic_task

* fix example
2022-07-31 15:15:00 +00:00
Ayrat Badykov 133d142761
Async worker pool draft (#49)
* Async worker pool draft

* ignore all targets

* simple worker example

* add debug logs

* fix

* fix tests

* remove log

* remove debug logs

* fix clippy
2022-07-31 13:32:37 +00:00
Pmarquez 6222c15d99
Async scheduled tasks (#47)
* preparing queries for periodic tasks

* fixing clippy and some other things

* delete src/schema

* ignoring src/schema.rs

* fix compile error

* fix clippy

* Scheduler

* Scheduler done ??

* improve scheduler (#48)

* improve scheduler

* add number of restarts

* fix clippy

* add into attribute

* make number of restarts pub

* fixing bugs and start async scheduler tests

* fixing insert periodic task bug and scheduler tests bug

* fix clippy

* fix clippy tests

* fix clippy tests again

* fix task type :D

* Builder AsyncQueueTest and sleep in start

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
2022-07-31 11:40:24 +00:00
Pmarquez 2d724c3776
Async worker test (#46)
* preparing code to tests

* changing queue tests and starting worker tests with new struct AsyncQueueTest

* fix clippy and delete Debug trait

* fix warnings

* Get task by id in worker tests and AsyncQueueTest #[cfg(test)]

* Defaults and AsyncWorker Builder

* Testing :D

* Execute task specific type

* deleting Options and comment

* insert task is back git !!

* Test remove tasks and changing insert task auxiliar func
2022-07-27 17:05:05 +00:00
Pmarquez 8d0a23e2f9
Async Worker (#44)
* stating with async worker

* async sleep solve and update state test

* uncomenting line

* retention mode and sleep params in lib.rs

* fixing code style

* trying to solve

* dont like changes

* Add AsyncQueueable trait (#45)

* add trait

* update runnable trait

* fix test

Co-authored-by: Ayrat Badykov <ayratin555@gmail.com>
2022-07-23 17:24:22 +03:00