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
**No options parameter support**: The Elixir Manifold library supports an options parameter for tuning performance characteristics (like partition size). This Gleam wrapper doesn't currently expose these options, though this could be added in the future.
56
+
The library supports the same options as the Elixir Manifold library for tuning performance:
57
+
58
+
#### Pack Modes
59
+
60
+
Control how messages are serialized before sending:
61
+
62
+
```gleam
63
+
import gleam_manifold as manifold
64
+
65
+
pub fn send_with_packing() {
66
+
let subject = manifold.new_subject()
67
+
let pid = process.self()
68
+
69
+
// Binary packing - efficient for large messages sent to many processes
70
+
manifold.send_with_options(
71
+
pid,
72
+
subject,
73
+
large_data,
74
+
[manifold.PackModeOption(manifold.Binary)]
75
+
)
76
+
77
+
// ETF (Erlang Term Format) - default behavior
78
+
manifold.send_with_options(
79
+
pid,
80
+
subject,
81
+
data,
82
+
[manifold.PackModeOption(manifold.Etf)]
83
+
)
84
+
85
+
// No packing
86
+
manifold.send_with_options(
87
+
pid,
88
+
subject,
89
+
data,
90
+
[manifold.PackModeOption(manifold.NoPacking)]
91
+
)
92
+
}
93
+
```
94
+
95
+
#### Send Modes
96
+
97
+
Control how messages are delivered:
98
+
99
+
```gleam
100
+
import gleam_manifold as manifold
101
+
102
+
pub fn send_with_offload() {
103
+
let subject = manifold.new_subject()
104
+
let pids = get_many_pids()
105
+
106
+
// Offload mode - non-blocking, routes through sender processes
107
+
manifold.send_multi_with_options(
108
+
pids,
109
+
subject,
110
+
message,
111
+
[manifold.SendModeOption(manifold.Offload)]
112
+
)
113
+
114
+
// Direct mode (default) - sends directly
115
+
manifold.send_multi_with_options(
116
+
pids,
117
+
subject,
118
+
message,
119
+
[manifold.SendModeOption(manifold.Direct)]
120
+
)
121
+
}
122
+
```
123
+
124
+
#### Combining Options
125
+
126
+
You can combine multiple options for fine-tuned control:
0 commit comments