This has been thought about before on this forum. The solutions were
1) to have multiple simultaneous logins with all of that overhead, so each process maintains its own connection to Bullhorn, or
2) to have a singleton that supplies the Bullhorn Rest Token to all processes. On any process (client) getting a token expiry, the process makes a blocking call to the singleton to get a new BhRestToken. All other clients will expire on their next call to Bullhorn, so they will need to ask for a new BhRestToken as well, but since the first process initiated a refresh, the token they get will be current.
So you have to make sure that the singleton blocks all Bullhorn calls while doing the refresh. I would do that by making the clients ask for the BhRestToken on every call (don't cache it) and then if a refresh is needed, make them wait until the refresh returns to get the BhRestToken.
Implementation of that is language- and server-specific, but hopefully that helps.
North Creek Consulting, Inc.https://northcreek.ca