You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,40 @@ To use Cedux you'll need to copy the following files into your application.
76
76
77
77
See example.c for a demonstration.
78
78
79
+
### Configuration
80
+
By default, cedux has the following maximum values set:
81
+
- Maximum of **16** actions can be dispatched between runs of the `cedux_run_store`
82
+
- Maximum of **32** reducers can be registered
83
+
- Maximum of **32** subscribers can be registered
84
+
85
+
However, these limitations can be altered if needed. Cedux references the following defines:
86
+
- CEDUX_MAX_ACTIONS
87
+
- CEDUX_MAX_REDUCERS
88
+
- CEDUX_MAX_SUBSCRIBERS
89
+
90
+
You must define these values before `#include`ing cedux.h like so:
91
+
92
+
```
93
+
#define CEDUX_MAX_ACTIONS 256 // Must be a factor of 2
94
+
#define CEDUX_MAX_REDUCERS 128 // Must be a factor of 2
95
+
#define CEDUX_MAX_SUBSCRIBERS 256 // Must be a factor of 2
96
+
#include "cedux.h"
97
+
```
98
+
99
+
As noted above, the CEXUX_MAX_X values must be factors of 2 in order for the cedux internals to work correctly.
100
+
79
101
### Thread Safety
80
102
81
103
For applications that require thread safety guarantees, Cedux provides the option to register platform-specific locking functions around the action queue so that multiple threads can dispatch actions at the time that Cedux is processing them. If you don't need thread safety in your application, you can skip this step. Use the `cedux_set_threadsafe_x` function to provide a handle to a platform-specific lock variable and wrapper functions to acquire and release the lock. Note that the lock should be initialized before passing it to Cedux. See `threadsafe_example.c` for an implementation using POSIX threads.
104
+
105
+
106
+
## Testing
107
+
This project is setup with unit testing using Ceedling (Unity and CMock)
108
+
109
+
### To setup testing environment
110
+
1. Setup rbenv. This will ensure the expected version or ruby is used.
// p_store is a void pointer here because we don't have access to the correct store handle type... We'll have to use a cast in the test when registering this.
0 commit comments