Comments (3)
I don't think having a default that sleeps is good. It would be better to just put it into the hello-nostr
example and I can explain why it is there.
I like the wait_for_send
but I'm not sure if it would be used much outside of tutorials, so if I can solve it by putting in a sleep, I think that is best.
from hello-nostr.
You forgot to call the connect
method.
By the way, there was a bug: calling event_id.to_string()
with nip19
feature enabled, return the bech32 id instead of hex.
Now is fixed.
The last problem in this example is that rust execute everything very fast so when you call get_events_of
the relay not found that event.
A solution is to put a std::thread::sleep(...)
between publish_text_note
and get_events_of
(a second is sufficient).
The last thing, by default the Client
not wait that an event is sent (for this in needed configure the Client
with Options
). Maybe is better to set by default that Client wait that an event is sent before continue, what do you think?
I don't know what is the best solution. For example, in a client that listen continuosly for events is better to set this to off but in a CLI app that send only an event and that exit, is better to turn on that option.
I talking about this:
let opts = Options::new().wait_for_send(true);
let client = Client::new_with_opts(&my_keys, opts);
from hello-nostr.
Should I set a default sleep
in get_events_of
and req_events_of
methods?
from hello-nostr.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hello-nostr.