Integrations
This page provides examples for the various frameworks that threadButler provides special integration utilities for.
Owlkettle
Integration with owlkettle works by threadButler essentially not providing an event-loop. Instead it hooks into owlkettle's GTK event-loop to listen for and react to messages.
The following "Special rules" need to be kept in mind when running ThreadButler with owlkettle:
- Add a field to
App
for theServer
instance for the owlkettle thread. - Create a listener startup event and add it to the
brew
call - Use
owlThreadServer
instead ofthreadServer
, but only for your owlkettle thread
Note:owlThreadServer
requires handlers to have a different proc signature. See the reference docs for more details. - Use
prepareOwlServers
instead ofprepareServers
In order to make data from messages available within owlkettle, add more fields
to AppState
.
You can then assign values from your messages to those fields and use them
in your view
method.
Owlkettle - Custom Event Loop
Demonstrates how to put owlkettle's GTK event-loop into its own threadServer, essentially turning this into a 3 threads setup with a main-thread, a thread for owlkettle and a thread for the server.
Listens for user-input from the terminal and sends it to the owlkettle thread.